[][src]Trait actix_storage::dev::Store

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

Set of method for basic storage providers to implement.

Required methods

#[must_use]fn set<'life0, 'async_trait>(
    &'life0 self,
    key: Arc<[u8]>,
    value: Arc<[u8]>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

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

#[must_use]fn get<'life0, 'async_trait>(
    &'life0 self,
    key: Arc<[u8]>
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<[u8]>>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

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

#[must_use]fn delete<'life0, 'async_trait>(
    &'life0 self,
    key: Arc<[u8]>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

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

#[must_use]fn contains_key<'life0, 'async_trait>(
    &'life0 self,
    key: Arc<[u8]>
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Check if key exist in storage

Loading content...

Implementations on Foreign Types

impl<T> Store for Addr<T> where
    T: Actor + Handler<StoreRequest> + Sync + Send,
    T::Context: ToEnvelope<T, StoreRequest>, 
[src]

Loading content...

Implementors

Loading content...