Trait tvix_castore::directoryservice::DirectoryPutter

source ·
pub trait DirectoryPutter: Send {
    // Required methods
    fn put<'life0, 'async_trait>(
        &'life0 mut self,
        directory: Directory,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Provides a handle to put a closure of connected Directory elements.

The consumer can periodically call DirectoryPutter::put, starting from the leaves. Once the root is reached, DirectoryPutter::close can be called to retrieve the root digest (or an error).

DirectoryPutters might be created without a single DirectoryPutter::put, and then dropped without calling DirectoryPutter::close, for example when ingesting a path that ends up not pointing to a directory, but a single file or symlink.

Required Methods§

source

fn put<'life0, 'async_trait>( &'life0 mut self, directory: Directory, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Put a individual Directory into the store. Error semantics and behaviour is up to the specific implementation of this trait. Due to bursting, the returned error might refer to an object previously sent via put.

source

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the stream, and wait for any errors. If there’s been any invalid Directory message uploaded, and error must be returned.

Implementors§