pub trait Publish<R>: Sealed {
type Error;
type Id;
// Required methods
fn publish<C>(
&self,
paths: C,
remotes: HashMap<Label, (Version, Self::Id)>,
) -> Vec<Result<Result<Record<R>, Label>, Self::Error>>
where C: IntoIterator<Item = PathBuf>;
fn publish_atom<P: AsRef<Path>>(
&self,
path: P,
remotes: &HashMap<Label, (Version, Self::Id)>,
) -> Result<Result<Record<R>, Label>, Self::Error>;
}Expand description
The primary trait for exposing atom publishing logic for a given store.
Required Associated Types§
Required Methods§
Sourcefn publish<C>(
&self,
paths: C,
remotes: HashMap<Label, (Version, Self::Id)>,
) -> Vec<Result<Result<Record<R>, Label>, Self::Error>>where
C: IntoIterator<Item = PathBuf>,
fn publish<C>(
&self,
paths: C,
remotes: HashMap<Label, (Version, Self::Id)>,
) -> Vec<Result<Result<Record<R>, Label>, Self::Error>>where
C: IntoIterator<Item = PathBuf>,
Publishes a collection of atoms.
This function processes a collection of paths, each representing an atom
to be published, by calling Publish::publish_atom for each path.
§Error Handling
The function processes all provided paths, even if some fail. Errors and skipped atoms are collected as results but do not halt the overall process.
§Return Value
Returns a vector of results. The outer Result represents a failure
to publish an atom, while the inner Result (PublishOutcome)
indicates whether an atom was published or safely skipped because it
already exists.
Sourcefn publish_atom<P: AsRef<Path>>(
&self,
path: P,
remotes: &HashMap<Label, (Version, Self::Id)>,
) -> Result<Result<Record<R>, Label>, Self::Error>
fn publish_atom<P: AsRef<Path>>( &self, path: P, remotes: &HashMap<Label, (Version, Self::Id)>, ) -> Result<Result<Record<R>, Label>, Self::Error>
Publishes a single atom.
This function takes a single path and publishes the atom located there.
§Return Value
- An
Okvariant containing a PublishOutcome, which is either theRecord<R>of the successfully published atom or theLabelif it was safely skipped. - An
Errvariant containing aSelf::Errorif the atom could not be published for any reason (e.g., an invalid manifest).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.