pub struct SessionPersistence;Expand description
Session persistence utilities for managing session data in XDG directories.
This module provides functionality to save and load Last.fm session data
using the XDG Base Directory Specification. Sessions are stored per-user
in the format: ~/.local/share/lastfm-edit/users/{username}/session.json
§Deprecated
Use SessionManager instead for more flexibility and customization.
Implementations§
Source§impl SessionPersistence
impl SessionPersistence
Sourcepub fn get_session_path(username: &str) -> Result<PathBuf>
pub fn get_session_path(username: &str) -> Result<PathBuf>
Get the session file path for a given username using XDG directories.
Returns a path like: ~/.local/share/lastfm-edit/users/{username}/session.json
§Arguments
username- The Last.fm username
§Returns
Returns the path where the session should be stored, or an error if the XDG data directory cannot be determined.
Sourcepub fn save_session(session: &LastFmEditSession) -> Result<()>
pub fn save_session(session: &LastFmEditSession) -> Result<()>
Sourcepub fn load_session(username: &str) -> Result<LastFmEditSession>
pub fn load_session(username: &str) -> Result<LastFmEditSession>
Sourcepub fn session_exists(username: &str) -> bool
pub fn session_exists(username: &str) -> bool
Sourcepub fn remove_session(username: &str) -> Result<()>
pub fn remove_session(username: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for SessionPersistence
impl RefUnwindSafe for SessionPersistence
impl Send for SessionPersistence
impl Sync for SessionPersistence
impl Unpin for SessionPersistence
impl UnwindSafe for SessionPersistence
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more