[−][src]Struct oauth2::StandardTokenResponse
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]
EF: ExtraTokenFields,
TT: TokenType,
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]
EF: ExtraTokenFields,
TT: TokenType,
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]
fn eq(&self, other: &StandardTokenResponse<EF, TT>) -> bool
[src]
fn ne(&self, other: &StandardTokenResponse<EF, TT>) -> bool
[src]
impl<EF: Clone + ExtraTokenFields, TT: Clone + TokenType> Clone for StandardTokenResponse<EF, TT>
[src]
fn clone(&self) -> 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]
TT: TokenType,
EF: ExtraTokenFields,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, EF: ExtraTokenFields, TT: TokenType> Deserialize<'de> for StandardTokenResponse<EF, TT> where
TT: TokenType,
EF: ExtraTokenFields,
[src]
TT: TokenType,
EF: ExtraTokenFields,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<EF, TT> Send for StandardTokenResponse<EF, TT> where
EF: Send,
TT: Send,
EF: Send,
TT: Send,
impl<EF, TT> Sync for StandardTokenResponse<EF, TT> where
EF: Sync,
TT: Sync,
EF: Sync,
TT: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same for T
type Output = T
Should always be Self