Struct FsPersistence
pub struct FsPersistence { /* private fields */ }Expand description
File-system persistence (good for development and single-server deployments).
Implementations§
§impl FsPersistence
impl FsPersistence
pub fn new(dir: impl Into<PathBuf>) -> FsPersistence
pub fn new(dir: impl Into<PathBuf>) -> FsPersistence
Create a new file-system persistence backend.
The directory will be created if it doesn’t exist.
Trait Implementations§
§impl SessionPersistence for FsPersistence
impl SessionPersistence for FsPersistence
§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,
FsPersistence: '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,
FsPersistence: '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,
FsPersistence: '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,
FsPersistence: 'async_trait,
Load a previously saved session snapshot.
Auto Trait Implementations§
impl Freeze for FsPersistence
impl RefUnwindSafe for FsPersistence
impl Send for FsPersistence
impl Sync for FsPersistence
impl Unpin for FsPersistence
impl UnwindSafe for FsPersistence
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