Skip to main content

DistributedStore

Trait DistributedStore 

Source
pub trait DistributedStore: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        domain: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, DistributedError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        domain: &'life1 str,
        key: &'life2 str,
        value: &'life3 [u8],
        ttl_sec: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<(), DistributedError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        domain: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), DistributedError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

An abstraction for a distributed key-value store.

Required Methods§

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, domain: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, DistributedError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve a value from the store.

Source

fn set<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, domain: &'life1 str, key: &'life2 str, value: &'life3 [u8], ttl_sec: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<(), DistributedError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set a value in the store, optionally with a time-to-live (in seconds).

Source

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

Delete a value from the store.

Implementors§