Trait persist::storage::BlobRead[][src]

pub trait BlobRead: Send + 'static {
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn list_keys<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn close<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

An abstraction over read-only access to a bytes key->bytes value store.

Required methods

Returns a reference to the value corresponding to the key.

List all of the keys in the map.

Synchronously closes the blob, causing all future commands to error.

If Self also implements Blob, this releases the exclusive-writer lock.

Implementations must be idempotent. Returns true if the blob had not previously been closed.

NB: It’s confusing for this to be on BlobRead, since it’s a no-op on the various concrete {Mem,File,S3}Read impls, but in various places we need to be able to close something that we only know is a BlobRead. Possible there’s something better we could be doing here.

Implementors