pub trait PersistenceStorageReadAndWrite<K, V>: PersistenceStorageOperation {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 K
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn put<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 K,
        entry: &'life2 V
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn get_all<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(K, V), Global>, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Persistence Storage read and write functions

Required Methods§

source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 K ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get a cache entry by key.

source

fn put<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 K, entry: &'life2 V ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Put entry in the cache under key.

source

fn get_all<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<(K, V), Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Implementors§

source§

impl<K, V, I> PersistenceStorageReadAndWrite<K, V> for Iwhere K: ToString + FromStr + Sync + Send + Debug, V: DeserializeOwned + Serialize + Sync + Send, I: PersistenceStorageOperation + Sync + KvStorageBasic,