pub struct FileSessionStore { /* private fields */ }Implementations§
Source§impl FileSessionStore
impl FileSessionStore
Sourcepub fn new(base_dir: impl Into<PathBuf>) -> Self
pub fn new(base_dir: impl Into<PathBuf>) -> Self
Create a file-backed session store.
If a Tokio runtime is available, a background flush task is started
(every 5s). Without a runtime, automatic periodic flushing is disabled;
callers should invoke flush() explicitly for durability.
pub async fn load_meta(&self, session_id: &str) -> Result<Option<SessionMeta>>
Trait Implementations§
Source§impl Drop for FileSessionStore
impl Drop for FileSessionStore
Source§impl SessionStore for FileSessionStore
impl SessionStore for FileSessionStore
fn append<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message: &'life2 Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn flush<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn as_any(&self) -> &dyn Any
Auto Trait Implementations§
impl Freeze for FileSessionStore
impl !RefUnwindSafe for FileSessionStore
impl Send for FileSessionStore
impl Sync for FileSessionStore
impl Unpin for FileSessionStore
impl UnsafeUnpin for FileSessionStore
impl !UnwindSafe for FileSessionStore
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