pub struct SessionStore {
pub sessions: HashMap<String, SessionEntry>,
}Fields§
§sessions: HashMap<String, SessionEntry>Implementations§
Source§impl SessionStore
impl SessionStore
pub fn load(path: &Path) -> Result<Self>
pub fn save(&self, path: &Path) -> Result<()>
pub fn get(&self, session_key: &str) -> Option<&SessionEntry>
pub fn create_or_get(&mut self, session_key: &str) -> &mut SessionEntry
pub fn update( &mut self, session_key: &str, f: impl FnOnce(&mut SessionEntry), ) -> Result<()>
Sourcepub fn reset_compaction_state(&mut self, session_key: &str)
pub fn reset_compaction_state(&mut self, session_key: &str)
Reset compaction-related fields for a fresh session (e.g. after /new or clear).
Trait Implementations§
Source§impl Clone for SessionStore
impl Clone for SessionStore
Source§fn clone(&self) -> SessionStore
fn clone(&self) -> SessionStore
Returns a duplicate 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 SessionStore
impl Debug for SessionStore
Source§impl Default for SessionStore
impl Default for SessionStore
Source§fn default() -> SessionStore
fn default() -> SessionStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionStore
impl<'de> Deserialize<'de> for SessionStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SessionStore
impl RefUnwindSafe for SessionStore
impl Send for SessionStore
impl Sync for SessionStore
impl Unpin for SessionStore
impl UnsafeUnpin for SessionStore
impl UnwindSafe for SessionStore
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