pub struct AuthClient { /* private fields */ }Expand description
Application credentials only — no session key yet.
Implementations§
Source§impl AuthClient
impl AuthClient
pub fn new( service: ScrobbleService, api_key: String, api_secret: String, ) -> Self
pub fn service(&self) -> ScrobbleService
Sourcepub async fn get_token(&self) -> Result<String>
pub async fn get_token(&self) -> Result<String>
Step 1: request a short-lived token from the API.
Step 2: URL the user must open in a browser to approve the app.
Sourcepub async fn get_session(&self, token: &str) -> Result<AuthSession>
pub async fn get_session(&self, token: &str) -> Result<AuthSession>
Step 3: exchange the approved token for a permanent session key.
Trait Implementations§
Source§impl Clone for AuthClient
impl Clone for AuthClient
Source§fn clone(&self) -> AuthClient
fn clone(&self) -> AuthClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AuthClient
impl !UnwindSafe for AuthClient
impl Freeze for AuthClient
impl Send for AuthClient
impl Sync for AuthClient
impl Unpin for AuthClient
impl UnsafeUnpin for AuthClient
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