pub struct FileSessionDataStore { /* private fields */ }Expand description
File-system SessionDataStore backed by JSON files.
Each session’s data is stored in a single JSON file under the configured
directory. No external dependencies — uses tokio::task::spawn_blocking
with std::fs for blocking I/O. Per-session locking prevents concurrent
writes to the same file.
Implementations§
Trait Implementations§
Source§impl Debug for FileSessionDataStore
impl Debug for FileSessionDataStore
Source§impl SessionDataStore for FileSessionDataStore
impl SessionDataStore for FileSessionDataStore
Source§fn set<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: String,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: String,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores a value under
(session_id, key), overwriting any existing value. Read moreSource§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the value stored under
(session_id, key). Read moreSource§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: Uuid,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes the value stored under
(session_id, key). Read moreAuto Trait Implementations§
impl Freeze for FileSessionDataStore
impl RefUnwindSafe for FileSessionDataStore
impl Send for FileSessionDataStore
impl Sync for FileSessionDataStore
impl Unpin for FileSessionDataStore
impl UnsafeUnpin for FileSessionDataStore
impl UnwindSafe for FileSessionDataStore
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