Struct MemoryPersistence
pub struct MemoryPersistence { /* private fields */ }Expand description
In-memory persistence (good for tests).
Implementations§
§impl MemoryPersistence
impl MemoryPersistence
pub fn new() -> MemoryPersistence
pub fn new() -> MemoryPersistence
Create a new in-memory persistence backend.
Trait Implementations§
§impl Default for MemoryPersistence
impl Default for MemoryPersistence
§fn default() -> MemoryPersistence
fn default() -> MemoryPersistence
Returns the “default value” for a type. Read more
§impl SessionPersistence for MemoryPersistence
impl SessionPersistence for MemoryPersistence
§fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
snapshot: &'life2 SessionSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryPersistence: 'async_trait,
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
snapshot: &'life2 SessionSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MemoryPersistence: 'async_trait,
Save a session snapshot.
§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionSnapshot>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryPersistence: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionSnapshot>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryPersistence: 'async_trait,
Load a previously saved session snapshot.
Auto Trait Implementations§
impl Freeze for MemoryPersistence
impl !RefUnwindSafe for MemoryPersistence
impl Send for MemoryPersistence
impl Sync for MemoryPersistence
impl Unpin for MemoryPersistence
impl !UnwindSafe for MemoryPersistence
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