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§
sourcefn 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 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,
Set a key-value pair, if the key already exist, value should be overwritten
sourcefn 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 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,
Get a value for specified key, it should result in None if the value does not exist