pub struct OAuthClient { /* private fields */ }
Expand description
Struct that handle obtaining and refreshing access tokens.
Implementations§
Source§impl OAuthClient
impl OAuthClient
Sourcepub fn get_access_token(&self) -> Result<OAuthToken, OAuthError>
pub fn get_access_token(&self) -> Result<OAuthToken, OAuthError>
Syncronously obtain a Spotify access token using the authorization code with PKCE OAuth flow.
Sourcepub fn refresh_token(
&self,
refresh_token: &str,
) -> Result<OAuthToken, OAuthError>
pub fn refresh_token( &self, refresh_token: &str, ) -> Result<OAuthToken, OAuthError>
Synchronously obtain a new valid OAuth token from refresh_token
Sourcepub async fn get_access_token_async(&self) -> Result<OAuthToken, OAuthError>
pub async fn get_access_token_async(&self) -> Result<OAuthToken, OAuthError>
Asyncronously obtain a Spotify access token using the authorization code with PKCE OAuth flow.
Sourcepub async fn refresh_token_async(
&self,
refresh_token: &str,
) -> Result<OAuthToken, OAuthError>
pub async fn refresh_token_async( &self, refresh_token: &str, ) -> Result<OAuthToken, OAuthError>
Asynchronously obtain a new valid OAuth token from refresh_token
Auto Trait Implementations§
impl Freeze for OAuthClient
impl RefUnwindSafe for OAuthClient
impl Send for OAuthClient
impl Sync for OAuthClient
impl Unpin for OAuthClient
impl UnwindSafe for OAuthClient
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