Trait Init

Source
pub trait Init<R, O, T: Send> {
    type Error;

    // Required methods
    fn sync(&self, transport: Option<&mut T>) -> Result<O, Self::Error>;
    fn ekala_init(&self, transport: Option<&mut T>) -> Result<(), Self::Error>;
    fn ekala_root(&self, transport: Option<&mut T>) -> Result<R, Self::Error>;
}
Expand description

A trait representing the methods required to initialize an Ekala store.

Required Associated Types§

Source

type Error

The error type returned by the methods of this trait.

Required Methods§

Source

fn sync(&self, transport: Option<&mut T>) -> Result<O, Self::Error>

Sync with the Ekala store, for implementations that require it.

Source

fn ekala_init(&self, transport: Option<&mut T>) -> Result<(), Self::Error>

Initialize the Ekala store.

Source

fn ekala_root(&self, transport: Option<&mut T>) -> Result<R, Self::Error>

Returns the root as reported by the remote store, or an error if it is inconsistent.

Implementations on Foreign Types§

Source§

impl<'repo> Init<Root, Ref, Box<dyn Transport + Send>> for Remote<'repo>

Source§

fn ekala_root( &self, transport: Option<&mut Box<dyn Transport + Send>>, ) -> Result<Root, Self::Error>

Determines if this remote is a valid Ekala store by pulling HEAD and the root tag, ensuring the latter is actually the root of HEAD, returning the root.

Source§

fn sync( &self, transport: Option<&mut Box<dyn Transport + Send>>, ) -> Result<Ref, Error>

Sync with the given remote and get the most up to date HEAD according to it.

Source§

fn ekala_init( &self, transport: Option<&mut Box<dyn Transport + Send>>, ) -> Result<(), Error>

Initialize the repository by calculating the root, according to the latest HEAD.

Source§

type Error = Error

Implementors§