[−][src]Trait twitch_oauth2::TwitchToken
Trait for twitch tokens to get fields and generalize over AppAccessToken and UserToken
Required methods
fn client_id(&self) -> &ClientId
Get the client-id. Twitch requires this in all helix api calls
fn token(&self) -> &AccessToken
Get the AccessToken for authenticating
fn login(&self) -> Option<&str>
Get the username associated to this token
#[must_use]fn refresh_token<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Refresh this token, changing the token to a newer one
fn expires(&self) -> Option<Instant>
Get instant when token will expire.
fn scopes(&self) -> Option<&[Scope]>
Retrieve scopes attached to the token
Provided methods
#[must_use]fn validate_token<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ValidatedToken, ValidationError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ValidatedToken, ValidationError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Validate this token. Should be checked on regularly, according to https://dev.twitch.tv/docs/authentication#validating-requests
#[must_use]fn revoke_token<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<(), RevokeTokenError>> + 'async_trait>> where
Self: Sized,
Self: 'async_trait,
self
) -> Pin<Box<dyn Future<Output = Result<(), RevokeTokenError>> + 'async_trait>> where
Self: Sized,
Self: 'async_trait,
Revoke the token. See https://dev.twitch.tv/docs/authentication#revoking-access-tokens
Implementations on Foreign Types
impl<T: TwitchToken> TwitchToken for Box<T>
[src]
fn client_id(&self) -> &ClientId
[src]
fn token(&self) -> &AccessToken
[src]
fn login(&self) -> Option<&str>
[src]
fn refresh_token<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn expires(&self) -> Option<Instant>
[src]
fn scopes(&self) -> Option<&[Scope]>
[src]
Implementors
impl TwitchToken for AppAccessToken
[src]
fn client_id(&self) -> &ClientId
[src]
fn token(&self) -> &AccessToken
[src]
fn login(&self) -> Option<&str>
[src]
fn refresh_token<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn expires(&self) -> Option<Instant>
[src]
fn scopes(&self) -> Option<&[Scope]>
[src]
impl TwitchToken for UserToken
[src]
fn client_id(&self) -> &ClientId
[src]
fn token(&self) -> &AccessToken
[src]
fn login(&self) -> Option<&str>
[src]
fn refresh_token<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,