pub struct SessionManager { /* private fields */ }Expand description
Manages session persistence and retrieval.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(sessions_dir: PathBuf) -> Result<Self>
pub fn new(sessions_dir: PathBuf) -> Result<Self>
Creates a new session manager.
§Errors
Returns SessionError if the sessions directory cannot be created.
Sourcepub fn create_session(&mut self, name: Option<&str>) -> Result<Session>
pub fn create_session(&mut self, name: Option<&str>) -> Result<Session>
Creates a new session with optional name.
§Errors
Returns SessionError if the session file cannot be written.
Sourcepub fn load_session(&self, session_id: &str) -> Result<Session>
pub fn load_session(&self, session_id: &str) -> Result<Session>
Loads a session by ID. Loads a session from disk by ID.
§Errors
Returns SessionError if the session file cannot be read or parsed.
Auto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl UnwindSafe for SessionManager
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