Skip to main content

BlobStore

Trait BlobStore 

Source
pub trait BlobStore {
    // Required methods
    fn put<'life0, 'async_trait>(
        &'life0 self,
        bytes: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Id> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Id,
    ) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Id,
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Blob storage for Attachment file/image content (spec §3): separate from ComponentStore since blobs aren’t a per-task-capability row — a task’s Attachments component only carries a blob id reference.

Required Methods§

Source

fn put<'life0, 'async_trait>( &'life0 self, bytes: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Id> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Store bytes, returning an id to fetch them back by. Content-addressed (same bytes ⇒ same id) — a cheap, incidental dedup, not a guarantee.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Id, ) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Id, ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§