[][src]Struct oauth2::StandardTokenResponse

pub struct StandardTokenResponse<EF: ExtraTokenFields, TT: TokenType> { /* fields omitted */ }

Standard OAuth2 token response.

This struct includes the fields defined in Section 5.1 of RFC 6749, as well as extensions defined by the EF type parameter.

Methods

impl<EF, TT> StandardTokenResponse<EF, TT> where
    EF: ExtraTokenFields,
    TT: TokenType
[src]

pub fn new(access_token: AccessToken, token_type: TT, extra_fields: EF) -> Self[src]

Instantiate a new OAuth2 token response.

pub fn set_access_token(&mut self, access_token: AccessToken)[src]

Set the access_token field.

pub fn set_token_type(&mut self, token_type: TT)[src]

Set the token_type field.

pub fn set_expires_in(&mut self, expires_in: Option<u64>)[src]

Set the expires_in field.

pub fn set_refresh_token(&mut self, refresh_token: Option<RefreshToken>)[src]

Set the refresh_token field.

pub fn set_scopes(&mut self, scopes: Option<Vec<Scope>>)[src]

Set the scopes field.

pub fn extra_fields(&self) -> &EF[src]

Extra fields defined by the client application.

pub fn set_extra_fields(&mut self, extra_fields: EF)[src]

Set the extra fields defined by the client application.

Trait Implementations

impl<EF, TT> TokenResponse<TT> for StandardTokenResponse<EF, TT> where
    EF: ExtraTokenFields,
    TT: TokenType
[src]

fn access_token(&self) -> &AccessToken[src]

REQUIRED. The access token issued by the authorization server.

fn token_type(&self) -> &TT[src]

REQUIRED. The type of the token issued as described in Section 7.1. Value is case insensitive and deserialized to the generic TokenType parameter.

fn expires_in(&self) -> Option<Duration>[src]

RECOMMENDED. The lifetime in seconds of the access token. For example, the value 3600 denotes that the access token will expire in one hour from the time the response was generated. If omitted, the authorization server SHOULD provide the expiration time via other means or document the default value.

fn refresh_token(&self) -> Option<&RefreshToken>[src]

OPTIONAL. The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in Section 6.

fn scopes(&self) -> Option<&Vec<Scope>>[src]

OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. The scipe of the access token as described by Section 3.3. If included in the response, this space-delimited field is parsed into a Vec of individual scopes. If omitted from the response, this field is None.

impl<EF: PartialEq + ExtraTokenFields, TT: PartialEq + TokenType> PartialEq<StandardTokenResponse<EF, TT>> for StandardTokenResponse<EF, TT>[src]

impl<EF: Clone + ExtraTokenFields, TT: Clone + TokenType> Clone for StandardTokenResponse<EF, TT>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<EF: Debug + ExtraTokenFields, TT: Debug + TokenType> Debug for StandardTokenResponse<EF, TT>[src]

impl<EF: ExtraTokenFields, TT: TokenType> Serialize for StandardTokenResponse<EF, TT> where
    TT: TokenType,
    EF: ExtraTokenFields
[src]

impl<'de, EF: ExtraTokenFields, TT: TokenType> Deserialize<'de> for StandardTokenResponse<EF, TT> where
    TT: TokenType,
    EF: ExtraTokenFields
[src]

Auto Trait Implementations

impl<EF, TT> Send for StandardTokenResponse<EF, TT> where
    EF: Send,
    TT: Send

impl<EF, TT> Sync for StandardTokenResponse<EF, TT> where
    EF: Sync,
    TT: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self