[][src]Struct oauth2::StandardTokenResponse

pub struct StandardTokenResponse<EF, TT> where
    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.

Implementations

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<&Duration>)[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: Clone, TT: Clone> Clone for StandardTokenResponse<EF, TT> where
    EF: ExtraTokenFields,
    TT: TokenType
[src]

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

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

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

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.

Auto Trait Implementations

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

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

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

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

Blanket Implementations

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

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,