[−][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.
Implementations
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<&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]
EF: ExtraTokenFields,
TT: TokenType,
fn clone(&self) -> StandardTokenResponse<EF, TT>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<EF: Debug, TT: Debug> Debug for StandardTokenResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
[src]
EF: ExtraTokenFields,
TT: TokenType,
impl<'de, EF, TT> Deserialize<'de> for StandardTokenResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
TT: TokenType,
EF: ExtraTokenFields,
[src]
EF: ExtraTokenFields,
TT: TokenType,
TT: TokenType,
EF: ExtraTokenFields,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<EF, TT> Serialize for StandardTokenResponse<EF, TT> where
EF: ExtraTokenFields,
TT: TokenType,
TT: TokenType,
EF: ExtraTokenFields,
[src]
EF: ExtraTokenFields,
TT: TokenType,
TT: TokenType,
EF: ExtraTokenFields,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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
.
Auto Trait Implementations
impl<EF, TT> RefUnwindSafe for StandardTokenResponse<EF, TT> where
EF: RefUnwindSafe,
TT: RefUnwindSafe,
EF: RefUnwindSafe,
TT: RefUnwindSafe,
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,
impl<EF, TT> Unpin for StandardTokenResponse<EF, TT> where
EF: Unpin,
TT: Unpin,
EF: Unpin,
TT: Unpin,
impl<EF, TT> UnwindSafe for StandardTokenResponse<EF, TT> where
EF: UnwindSafe,
TT: UnwindSafe,
EF: UnwindSafe,
TT: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[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.
fn to_owned(&self) -> T
[src]
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,