KeyString

Trait KeyString 

Source
pub trait KeyString {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = TribResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        kv: &'life1 KeyValue,
    ) -> Pin<Box<dyn Future<Output = TribResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn keys<'life0, 'life1, 'async_trait>(
        &'life0 self,
        p: &'life1 Pattern,
    ) -> Pin<Box<dyn Future<Output = TribResult<List>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Key-value pair interfaces Default value for all keys is empty string

Required Methods§

Source

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

Gets a value. If no value set, return None

Source

fn set<'life0, 'life1, 'async_trait>( &'life0 self, kv: &'life1 KeyValue, ) -> Pin<Box<dyn Future<Output = TribResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set kv.key to kv.value. return true when no error.

Source

fn keys<'life0, 'life1, 'async_trait>( &'life0 self, p: &'life1 Pattern, ) -> Pin<Box<dyn Future<Output = TribResult<List>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all the keys of non-empty pairs where the key matches the given pattern.

Implementors§