Skip to main content

KeyValueStore

Trait KeyValueStore 

Source
pub trait KeyValueStore: Send + Sync {
    // Required methods
    fn get_bytes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<Option<KvEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_bytes<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        bytes: Bytes,
        content_type: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_keys<'life0, 'async_trait>(
        &'life0 self,
        opts: ListKeysOptions,
    ) -> Pin<Box<dyn Future<Output = StorageResult<KeyList>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Object-safe byte-oriented key-value storage.

Required Methods§

Source

fn get_bytes<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<Option<KvEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets a stored byte value.

Source

fn set_bytes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, bytes: Bytes, content_type: &'life2 str, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sets a stored byte value and content type.

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes a key, doing nothing when it is absent.

Source

fn list_keys<'life0, 'async_trait>( &'life0 self, opts: ListKeysOptions, ) -> Pin<Box<dyn Future<Output = StorageResult<KeyList>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists stored keys.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§