Trait rocket_session_store::Store
source · [−]pub trait Store: Send + Sync {
type Value;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str
) -> Pin<Box<dyn Future<Output = SessionResult<Option<Self::Value>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str
) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
A generic store in which to write and retrive sessions either trough an in memory hashmap or a database connection.
Associated Types
Required methods
Get the value from the store
Set the value from the store
Touch the value, refreshing its expiry time.