pub fn user_login(&mut self) -> Result<()> {
        self.partner_login()
            .with_context(|| "Failed to ensure valid partner login before authenticating user")?;
        let session_tokens = self.inner.session_tokens();
        if session_tokens
            .user_id
            .as_ref()
            .and(session_tokens.user_token.as_ref())
            .is_some()
        {
            return Ok(());
        }

        trace!("User login");
        let username_opt = self.config.borrow().login.username();
        let username = username_opt.ok_or(Error::PanharmoniconMissingAuthToken)?;

        let password_opt = self.config.borrow().login.password()?;
        let password = password_opt.ok_or(Error::PanharmoniconMissingAuthToken)?;

        UserLogin::new(&username, &password).merge_response(&mut self.inner)?;
        trace!("User login successful");
        Ok(())
    }
/// Authenticate the user with Pandora.  If partner (application)
/// authentication has not already been performed, it will also do that.
/// It is not generally necessary to call this function directly, though,
/// as each method will authenticate as much as necessary to complete
/// the request.
Authenticate the user with Pandora.  If partner (application)
authentication has not already been performed, it will also do that.
It is not generally necessary to call this function directly, though,
as each method will authenticate as much as necessary to complete
the request.
Authenticate the user with Pandora . If partner ( application ) authentication has not already been performed it will also do that . It is not generally necessary to call this function directly though as each method will authenticate as much as necessary to complete the request .
pub fn user_login(&mut self) -> Result<()> {
        self.partner_login()
            .with_context(|| "Failed to ensure valid partner login before authenticating user")?;
        let session_tokens = self.inner.session_tokens();
        if session_tokens
            .user_id
            .as_ref()
            .and(session_tokens.user_token.as_ref())
            .is_some()
        {
            return Ok(());
        }
        trace!("User login");
        let username_opt = self.config.borrow().login.username();
        let username = username_opt.ok_or(Error::PanharmoniconMissingAuthToken)?;
        let password_opt = self.config.borrow().login.password()?;
        let password = password_opt.ok_or(Error::PanharmoniconMissingAuthToken)?;
        UserLogin::new(&username, &password).merge_response(&mut self.inner)?;
        trace!("User login successful");
        Ok(())
    }
pub fn user_login ( & mut self ) -> Result < ( ) > { self . partner_login ( ) . with_context ( | | " " ) ? ; let session_tokens = self . inner . session_tokens ( ) ; if session_tokens . user_id . as_ref ( ) . and ( session_tokens . user_token . as_ref ( ) ) . is_some ( ) { return Ok ( ( ) ) ; } trace ! ( " " ) ; let username_opt = self . config . borrow ( ) . login . username ( ) ; let username = username_opt . ok_or ( Error :: PanharmoniconMissingAuthToken ) ? ; let password_opt = self . config . borrow ( ) . login . password ( ) ? ; let password = password_opt . ok_or ( Error :: PanharmoniconMissingAuthToken ) ? ; UserLogin :: new ( & username , & password ) . merge_response ( & mut self . inner ) ? ; trace ! ( " " ) ; Ok ( ( ) ) }
Authenticate the user with Pandora.
Authenticate the user with Pandora .
&mut self
&mut self