[][src]Struct rspotify::oauth2::SpotifyClientCredentials

pub struct SpotifyClientCredentials {
    pub client_id: String,
    pub client_secret: String,
    pub token_info: Option<TokenInfo>,
}

Client credentials object for spotify

Fields

client_id: Stringclient_secret: Stringtoken_info: Option<TokenInfo>

Methods

impl SpotifyClientCredentials[src]

pub fn default() -> SpotifyClientCredentials[src]

build default SpotifyClientCredentials

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

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

pub fn token_info(self, token_info: TokenInfo) -> SpotifyClientCredentials[src]

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

pub async fn get_access_token<'_>(&'_ self) -> String[src]

get access token from self.token_info, if self.token_info is none or is expired. fetch token info by HTTP request

Trait Implementations

impl Clone for SpotifyClientCredentials[src]

impl Debug for SpotifyClientCredentials[src]

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

impl Serialize for SpotifyClientCredentials[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.