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§
Sourcefn 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 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.
Sourcefn 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_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.
Sourcefn 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,
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
impl<'b, T: 'b + BlobEngine + ?Sized> BlobEngine for &'b T
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,
Source§impl<'b, T: 'b + BlobEngine + ?Sized> BlobEngine for &'b mut T
impl<'b, T: 'b + BlobEngine + ?Sized> BlobEngine for &'b mut T
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,
Source§impl<T: BlobEngine + ?Sized> BlobEngine for Box<T>
impl<T: BlobEngine + ?Sized> BlobEngine for Box<T>
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,
Source§impl<T: BlobEngine + ?Sized> BlobEngine for Arc<T>
impl<T: BlobEngine + ?Sized> BlobEngine for Arc<T>
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,
Implementors§
impl BlobEngine for MockBlobEngine
Trait describing an interface to open blobs for reading and writing.