[−][src]Struct twitch_oauth2::AppAccessToken
An App Access Token from the OAuth client credentials flow
Implementations
impl AppAccessToken
[src]
pub fn from_existing_unchecked(
access_token: AccessToken,
client_id: impl Into<ClientId>,
client_secret: impl Into<ClientSecret>,
login: Option<String>,
scopes: Option<Vec<Scope>>
) -> AppAccessToken
[src]
access_token: AccessToken,
client_id: impl Into<ClientId>,
client_secret: impl Into<ClientSecret>,
login: Option<String>,
scopes: Option<Vec<Scope>>
) -> AppAccessToken
Assemble token without checks.
pub async fn from_existing<RE, C, F>(
http_client: C,
access_token: AccessToken,
client_secret: ClientSecret
) -> Result<AppAccessToken, ValidationError<RE>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
[src]
http_client: C,
access_token: AccessToken,
client_secret: ClientSecret
) -> Result<AppAccessToken, ValidationError<RE>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
pub async fn get_app_access_token<RE, C, F>(
http_client: C,
client_id: ClientId,
client_secret: ClientSecret,
scopes: Vec<Scope>
) -> Result<AppAccessToken, TokenError<RE>> where
RE: Error + Send + Sync + 'static,
C: Fn(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
[src]
http_client: C,
client_id: ClientId,
client_secret: ClientSecret,
scopes: Vec<Scope>
) -> Result<AppAccessToken, TokenError<RE>> where
RE: Error + Send + Sync + 'static,
C: Fn(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
Generate app access token via OAuth client credentials flow
Trait Implementations
impl Clone for AppAccessToken
[src]
pub fn clone(&self) -> AppAccessToken
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AppAccessToken
[src]
impl TwitchToken for AppAccessToken
[src]
pub fn client_id(&self) -> &ClientId
[src]
pub fn token(&self) -> &AccessToken
[src]
pub fn login(&self) -> Option<&str>
[src]
pub fn refresh_token<'life0, 'async_trait, RE, C, F>(
&'life0 mut self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError<RE>>> + 'async_trait>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<(), RefreshTokenError<RE>>> + 'async_trait>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
pub fn expires(&self) -> Option<Instant>
[src]
pub fn scopes(&self) -> Option<&[Scope]>
[src]
#[must_use]pub fn validate_token<'life0, 'async_trait, RE, C, F>(
&'life0 self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<ValidatedToken, ValidationError<RE>>> + 'async_trait>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<ValidatedToken, ValidationError<RE>>> + 'async_trait>> where
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
#[must_use]pub fn revoke_token<'async_trait, RE, C, F>(
self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<(), RevokeTokenError<RE>>> + 'async_trait>> where
Self: Sized,
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
Self: 'async_trait,
[src]
self,
http_client: C
) -> Pin<Box<dyn Future<Output = Result<(), RevokeTokenError<RE>>> + 'async_trait>> where
Self: Sized,
RE: Error + Send + Sync + 'static,
C: FnOnce(HttpRequest) -> F,
F: Future<Output = Result<HttpResponse, RE>>,
RE: 'async_trait,
C: 'async_trait,
F: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl RefUnwindSafe for AppAccessToken
[src]
impl Send for AppAccessToken
[src]
impl Sync for AppAccessToken
[src]
impl Unpin for AppAccessToken
[src]
impl UnwindSafe for AppAccessToken
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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.
pub 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>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,