Struct tower_sessions::MemoryStore
source ยท pub struct MemoryStore(/* private fields */);
Available on crate feature
memory-store
only.Expand description
A session store that lives only in memory.
This is useful for testing but not recommended for real applications.
ยงExamples
use tower_sessions::MemoryStore;
MemoryStore::default();
Trait Implementationsยง
sourceยงimpl Clone for MemoryStore
impl Clone for MemoryStore
sourceยงfn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
Returns a copy of the value. Read more
1.0.0 ยท sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceยงimpl Debug for MemoryStore
impl Debug for MemoryStore
sourceยงimpl Default for MemoryStore
impl Default for MemoryStore
sourceยงfn default() -> MemoryStore
fn default() -> MemoryStore
Returns the โdefault valueโ for a type. Read more
sourceยงimpl SessionStore for MemoryStore
impl SessionStore for MemoryStore
sourceยงfn create<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 mut Record
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 mut Record
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
Creates a new session in the store with the provided session record. Read more
sourceยงfn save<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 Record
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 Record
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
Saves the provided session record to the store. Read more
sourceยงfn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = Result<Option<Record>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = Result<Option<Record>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
Loads an existing session record from the store using the provided ID. Read more
sourceยงfn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Id
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryStore: 'async_trait,
Deletes a session record from the store using the provided ID. Read more
Auto Trait Implementationsยง
impl Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl !UnwindSafe for MemoryStore
Blanket Implementationsยง
sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more