Struct twitch_oauth2::tokens::AppAccessToken[][src]

pub struct AppAccessToken {
    pub access_token: AccessToken,
    pub refresh_token: Option<RefreshToken>,
    // some fields omitted
}
Expand description

An App Access Token from the OAuth client credentials flow

Used for server-to-server requests. Use UserToken for requests that need to be in the context of an authenticated user.

In some contexts (i.e EventSub) an App Access Token can be used in the context of users that have authenticated the specific Client ID

Fields

access_token: AccessToken

The access token used to authenticate requests with

refresh_token: Option<RefreshToken>

The refresh token used to extend the life of this user token

Implementations

Assemble token without checks.

If expires_in is None, we’ll assume token.is_elapsed() == true

Assemble token and validate it. Retrieves client_id and scopes.

Generate app access token via OAuth client credentials flow

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Get the type of token.

Client ID associated with the token. Twitch requires this in all helix API calls

Get the AccessToken for authenticating Read more

Get the username associated to this token

Get the user id associated to this token

Refresh this token, changing the token to a newer one

Get current lifetime of token.

Retrieve scopes attached to the token

Returns whether or not the token is expired. Read more

Validate this token. Should be checked on regularly, according to https://dev.twitch.tv/docs/authentication#validating-requests Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more