Trait Builder

Source
pub trait Builder<'a, R> {
    type Error;
    type Publisher: Publish<R>;

    // Required method
    fn build(
        self,
    ) -> Result<(HashMap<Label, PathBuf>, Self::Publisher), Self::Error>;
}
Expand description

A builder for a Publish implementation.

This trait is central to ensuring that vital invariants for maintaining a clean and consistent state in the store are verified before any publishing can occur. A Publish implementation can only be constructed through a builder.

Required Associated Types§

Source

type Error

The error type returned by the Builder::build method.

Source

type Publisher: Publish<R>

The Publish implementation to construct.

Required Methods§

Source

fn build( self, ) -> Result<(HashMap<Label, PathBuf>, Self::Publisher), Self::Error>

Collects and validates all atoms in the worktree.

This method must be called before publishing to ensure that there are no duplicate atoms. It is the only way to construct a Publish implementation.

Implementors§