pub struct ClientSession {
pub username: String,
pub session_cookies: Vec<String>,
pub csrf_token: Option<String>,
pub base_url: String,
}Expand description
Serializable client session state that can be persisted and restored.
This contains all the authentication state needed to resume a Last.fm session without requiring the user to log in again.
Fields§
§username: StringThe authenticated username
Session cookies required for authenticated requests
csrf_token: Option<String>CSRF token for form submissions
base_url: StringBase URL for the Last.fm instance
Implementations§
Source§impl ClientSession
impl ClientSession
Sourcepub fn new(
username: String,
session_cookies: Vec<String>,
csrf_token: Option<String>,
base_url: String,
) -> Self
pub fn new( username: String, session_cookies: Vec<String>, csrf_token: Option<String>, base_url: String, ) -> Self
Create a new client session with the provided state
Trait Implementations§
Source§impl Clone for ClientSession
impl Clone for ClientSession
Source§fn clone(&self) -> ClientSession
fn clone(&self) -> ClientSession
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 ClientSession
impl Debug for ClientSession
Source§impl<'de> Deserialize<'de> for ClientSession
impl<'de> Deserialize<'de> for ClientSession
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 ClientSession
impl RefUnwindSafe for ClientSession
impl Send for ClientSession
impl Sync for ClientSession
impl Unpin for ClientSession
impl UnwindSafe for ClientSession
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