CacheRaw

Trait CacheRaw 

Source
pub trait CacheRaw {
    // Required methods
    fn get_field<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        field: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_fields<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<u8>>, CacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn insert_field<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        field: &'life1 str,
        value: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn field_exists<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        field: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_field<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        field: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Exposes a “raw” cache interface, i.e. based on byte blobs rather than typed messages.

Required Methods§

Source

fn get_field<'life0, 'life1, 'async_trait>( &'life0 mut self, field: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves a field’s value from the cache.

Source

fn get_fields<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<u8>>, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all fields and their values for a given key from the cache.

Source

fn insert_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, field: &'life1 str, value: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Adds a field with given value to the cache. Returns true if an element was added,false if it existed before and was updated.

Source

fn field_exists<'life0, 'life1, 'async_trait>( &'life0 mut self, field: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if a specific field exists in the cache.

Source

fn delete_field<'life0, 'life1, 'async_trait>( &'life0 mut self, field: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes field from the cache. Returns true if that entry existed.

Implementors§