Skip to main content

BlobAdapter

Trait BlobAdapter 

Source
pub trait BlobAdapter:
    Debug
    + Send
    + Sync {
    // Required methods
    fn create_blob_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        file_id: &'life1 str,
        data: &'life2 [u8],
        opts: &'life3 CreateBlobOptions,
    ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn create_blob_stream<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        file_id: &'life1 str,
        stream: &'life2 mut (dyn AsyncRead + Send + Unpin),
    ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn stat_blob<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        blob_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_blob_buf<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        blob_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_blob_range<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        blob_id: &'life1 str,
        offset: u64,
        length: u64,
    ) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_blob_stream<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        blob_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_blob_from_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
        file_id: &'life1 str,
        source: &'life2 Path,
        opts: &'life3 CreateBlobOptions,
    ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn delete_tenant_blobs<'life0, 'async_trait>(
        &'life0 self,
        tn_id: TnId,
    ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn create_blob_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tn_id: TnId, file_id: &'life1 str, data: &'life2 [u8], opts: &'life3 CreateBlobOptions, ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Creates a new blob from a buffer

Source

fn create_blob_stream<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tn_id: TnId, file_id: &'life1 str, stream: &'life2 mut (dyn AsyncRead + Send + Unpin), ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Creates a new blob using a stream

Source

fn stat_blob<'life0, 'life1, 'async_trait>( &'life0 self, tn_id: TnId, blob_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stats a blob

Source

fn read_blob_buf<'life0, 'life1, 'async_trait>( &'life0 self, tn_id: TnId, blob_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads a blob

Source

fn read_blob_range<'life0, 'life1, 'async_trait>( &'life0 self, tn_id: TnId, blob_id: &'life1 str, offset: u64, length: u64, ) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads a byte range from a blob

Source

fn read_blob_stream<'life0, 'life1, 'async_trait>( &'life0 self, tn_id: TnId, blob_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reads a blob

Source

fn create_blob_from_path<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tn_id: TnId, file_id: &'life1 str, source: &'life2 Path, opts: &'life3 CreateBlobOptions, ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Creates a new blob by copying a file from a local path (no memory allocation)

Source

fn delete_tenant_blobs<'life0, 'async_trait>( &'life0 self, tn_id: TnId, ) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete every blob owned by the tenant. Treats a missing tenant directory as success. Used by tenant purge orchestration.

Implementors§