Trait actix_storage::dev::Store

source ·
pub trait Store: Send + Sync {
    fn set<'life0, 'async_trait>(
        &'life0 self,
        scope: Arc<[u8]>,
        key: Arc<[u8]>,
        value: Arc<[u8]>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn get<'life0, 'async_trait>(
        &'life0 self,
        scope: Arc<[u8]>,
        key: Arc<[u8]>
    ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<[u8]>>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn delete<'life0, 'async_trait>(
        &'life0 self,
        scope: Arc<[u8]>,
        key: Arc<[u8]>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn contains_key<'life0, 'async_trait>(
        &'life0 self,
        scope: Arc<[u8]>,
        key: Arc<[u8]>
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; }
Expand description

Set of method for basic storage providers to implement.

Required Methods§

Set a key-value pair, if the key already exist, value should be overwritten

Get a value for specified key, it should result in None if the value does not exist

Delete the key from storage, if the key doesn’t exist, it shouldn’t return an error

Check if key exist in storage

Implementations on Foreign Types§

Implementors§