[−][src]Struct aspotify::authorization::c_c_flow::CCFlow
An object that holds a reference to your client credentials, and caches access tokens with the Client Credentials authorization flow.
Examples
use aspotify::{ClientCredentials, CCFlow}; // Create a flow, taking credentials from environment variables. let flow = CCFlow::new( ClientCredentials::from_env() .expect("CLIENT_ID or CLIENT_SECRET environment variables not set") ); // Get a client credentials access token with: let token = flow.send().await.unwrap();
Methods
impl<'cc> CCFlow<'cc>
[src]
pub fn new(credentials: &'cc ClientCredentials) -> Self
[src]
Creates a new CCFlow from the client's credentials.
pub fn get_credentials(&self) -> &ClientCredentials
[src]
Get the client credentials.
pub async fn send<'_>(
&'_ self
) -> Result<AccessToken, EndpointError<AuthenticationError>>
[src]
&'_ self
) -> Result<AccessToken, EndpointError<AuthenticationError>>
Return the cache or send a request.
Trait Implementations
Auto Trait Implementations
impl<'cc> !RefUnwindSafe for CCFlow<'cc>
impl<'cc> Send for CCFlow<'cc>
impl<'cc> Sync for CCFlow<'cc>
impl<'cc> Unpin for CCFlow<'cc>
impl<'cc> !UnwindSafe for CCFlow<'cc>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,