Skip to main content

IndexedKvStore

Trait IndexedKvStore 

Source
pub trait IndexedKvStore<T>: KvStore<T> {
    // Required methods
    fn set_indexed<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        primary_key: &'life1 str,
        secondary_key: &'life2 str,
        value: T,
        ttl: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_by_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        secondary_key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Backends that can atomically write a value under a primary key while also maintaining a secondary lookup key implement this.

Required Methods§

Source

fn set_indexed<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, primary_key: &'life1 str, secondary_key: &'life2 str, value: T, ttl: Duration, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_by_index<'life0, 'life1, 'async_trait>( &'life0 self, secondary_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, StoreError>> + Send + '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§