Skip to main content

BlobEngine

Trait BlobEngine 

Source
pub trait BlobEngine: Send + Sync {
    // Required methods
    fn has<'life0, 'life1, 'async_trait>(
        &'life0 self,
        digest: &'life1 B3Digest,
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        digest: &'life1 B3Digest,
        size_hint: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_write<'a, 'async_trait>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
}
Expand description

Trait describing an interface to open blobs for reading and writing.

Required Methods§

Source

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

Check if the blob with this digest exists.

Source

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 B3Digest, size_hint: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request a blob from the store for reading. An optional size_hint can be specified, allowing some implementations to optimize.

Source

fn open_write<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Allows writing a new blob. Returns a crate::blobstore::Writer, which implements tokio::io::AsyncWrite and has a close method to finalize the blob and get its digest.

Implementations on Foreign Types§

Source§

impl<'b, T: 'b + BlobEngine + ?Sized> BlobEngine for &'b T
where &'b T: Send + Sync,

Source§

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

Source§

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 B3Digest, size_hint: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn open_write<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl<'b, T: 'b + BlobEngine + ?Sized> BlobEngine for &'b mut T
where &'b mut T: Send + Sync,

Source§

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

Source§

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 B3Digest, size_hint: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn open_write<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl<T: BlobEngine + ?Sized> BlobEngine for Box<T>
where Box<T>: Send + Sync,

Source§

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

Source§

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 B3Digest, size_hint: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn open_write<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Source§

impl<T: BlobEngine + ?Sized> BlobEngine for Arc<T>
where Arc<T>: Send + Sync,

Source§

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

Source§

fn open_read<'life0, 'life1, 'async_trait>( &'life0 self, digest: &'life1 B3Digest, size_hint: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn Reader + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn open_write<'a, 'async_trait>( &'a self, ) -> Pin<Box<dyn Future<Output = Box<dyn Writer + 'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Implementors§

Source§

impl BlobEngine for MockBlobEngine

Trait describing an interface to open blobs for reading and writing.

Source§

impl<BS, CS> BlobEngine for ChunkingBlobEngine<BS, CS>
where BS: BlobStore, CS: ChunkStore + Clone + 'static,