pub trait Store: Send + Sync {
type Value;
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SessionResult<Option<Self::Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
value: Self::Value,
duration: Duration,
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn touch<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
duration: Duration,
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A generic store in which to write and retrive sessions either trough an in memory hashmap or a database connection.
Required Associated Types§
Required Methods§
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SessionResult<Option<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = SessionResult<Option<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the value from the store
Sourcefn set<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
value: Self::Value,
duration: Duration,
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
value: Self::Value,
duration: Duration,
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set the value from the store