BlobStore

Trait BlobStore 

Source
pub trait BlobStore:
    Debug
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn put_blob(&self, data: &[u8], media_type: Option<&str>) -> Result<BlobRef>;
    fn get_blob(&self, blob_id: &str) -> Result<Option<StoredBlob>>;

    // Provided methods
    fn has_blob(&self, blob_id: &str) -> Result<bool> { ... }
    fn delete_unreferenced(
        &self,
        live_blob_ids: &BTreeSet<String>,
    ) -> Result<usize> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn put_blob(&self, data: &[u8], media_type: Option<&str>) -> Result<BlobRef>

Source

fn get_blob(&self, blob_id: &str) -> Result<Option<StoredBlob>>

Provided Methods§

Source

fn has_blob(&self, blob_id: &str) -> Result<bool>

Source

fn delete_unreferenced(&self, live_blob_ids: &BTreeSet<String>) -> Result<usize>

Implementors§

Source§

impl BlobStore for FileBlobStore

Available on non-WebAssembly only.
Source§

impl BlobStore for MemoryBlobStore