pub struct LoginManager { /* private fields */ }Expand description
Login functionality separated from the main client
Implementations§
Source§impl LoginManager
impl LoginManager
pub fn new(client: Arc<dyn HttpClient + Send + Sync>, base_url: String) -> Self
Sourcepub async fn login(
&self,
username: &str,
password: &str,
) -> Result<LastFmEditSession>
pub async fn login( &self, username: &str, password: &str, ) -> Result<LastFmEditSession>
Authenticate with Last.fm using username and password.
This method:
- Fetches the login page to extract CSRF tokens
- Submits the login form with credentials
- Validates the authentication by checking for session cookies
- Returns a valid session for use with the client
§Arguments
username- Last.fm username or emailpassword- Last.fm password
§Returns
Returns a LastFmEditSession on successful authentication, or LastFmError::Auth on failure.
Auto Trait Implementations§
impl Freeze for LoginManager
impl !RefUnwindSafe for LoginManager
impl Send for LoginManager
impl Sync for LoginManager
impl Unpin for LoginManager
impl !UnwindSafe for LoginManager
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