Trait sessions_core::Storage
source · [−]pub trait Storage: Send + Sync {
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Data>, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
val: Data,
exp: &'life2 Duration
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn reset<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn close<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
}
Expand description
A Storage Trait
Required Methods
Get a data from storage by the key
Set a session to storage
Provided Methods
Reset the storage and remove all keys