BlobStore

Trait BlobStore 

Source
pub trait BlobStore: Send + Sync {
    // Required methods
    fn get_blob<'life0, 'life1, 'async_trait>(
        &'life0 self,
        blob_id: &'life1 BlobId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upload_blob<'life0, 'life1, 'async_trait>(
        &'life0 self,
        blob: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<BlobId, BlobError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for blob storage operations, enabling mocking in tests

Required Methods§

Source

fn get_blob<'life0, 'life1, 'async_trait>( &'life0 self, blob_id: &'life1 BlobId, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, BlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Download a blob by its ID

Source

fn upload_blob<'life0, 'life1, 'async_trait>( &'life0 self, blob: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<BlobId, BlobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload a blob and return its hash

Implementors§