[][src]Struct rspotify::oauth2::SpotifyOAuth

pub struct SpotifyOAuth {
    pub client_id: String,
    pub client_secret: String,
    pub redirect_uri: String,
    pub state: String,
    pub cache_path: PathBuf,
    pub scope: String,
    pub proxies: Option<String>,
}

Authorization for spotify

Fields

client_id: Stringclient_secret: Stringredirect_uri: Stringstate: Stringcache_path: PathBufscope: Stringproxies: Option<String>

Methods

impl SpotifyOAuth[src]

pub fn default() -> SpotifyOAuth[src]

pub fn client_id(self, client_id: &str) -> SpotifyOAuth[src]

pub fn client_secret(self, client_secret: &str) -> SpotifyOAuth[src]

pub fn redirect_uri(self, redirect_uri: &str) -> SpotifyOAuth[src]

pub fn scope(self, scope: &str) -> SpotifyOAuth[src]

pub fn state(self, state: &str) -> SpotifyOAuth[src]

pub fn cache_path(self, cache_path: PathBuf) -> SpotifyOAuth[src]

pub fn proxies(self, proxies: &str) -> SpotifyOAuth[src]

pub fn build(self) -> SpotifyOAuth[src]

pub async fn get_cached_token<'_>(&'_ mut self) -> Option<TokenInfo>[src]

pub async fn get_access_token<'_, '_>(
    &'_ self,
    code: &'_ str
) -> Option<TokenInfo>
[src]

gets the access_token for the app given the code

pub fn parse_response_code(&self, url: &mut str) -> Option<String>[src]

Parse the response code in the given response url

pub fn get_authorize_url(
    &self,
    state: Option<&str>,
    show_dialog: Option<bool>
) -> String
[src]

Gets the URL to use to authorize this app

pub async fn refresh_access_token<'_, '_>(
    &'_ self,
    refresh_token: &'_ str
) -> Option<TokenInfo>
[src]

after refresh access_token, the response may be empty when refresh_token again

Trait Implementations

impl Clone for SpotifyOAuth[src]

impl Debug for SpotifyOAuth[src]

impl<'de> Deserialize<'de> for SpotifyOAuth[src]

impl Serialize for SpotifyOAuth[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.