Skip to main content

KeyValueStore

Trait KeyValueStore 

Source
pub trait KeyValueStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn set<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        collection: &'life1 str,
        key: &'life2 str,
        value: T,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where T: Serialize + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        collection: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, String>> + Send + 'async_trait>>
       where T: DeserializeOwned + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        collection: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_all<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        collection: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, String>> + Send + 'async_trait>>
       where T: DeserializeOwned + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

For storing and retrieving items by a unique string ID.

Required Methods§

Source

fn set<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, collection: &'life1 str, key: &'life2 str, value: T, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where T: Serialize + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, collection: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, String>> + Send + 'async_trait>>
where T: DeserializeOwned + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

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

Source

fn get_all<'life0, 'life1, 'async_trait, T>( &'life0 self, collection: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, String>> + Send + 'async_trait>>
where T: DeserializeOwned + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§