[−][src]Struct rocket_oauth2::TokenResponse
The server's response to a successful token exchange, defined in in RFC 6749 §5.1.
Methods
impl TokenResponse
[src]
pub fn as_value(&self) -> &Value
[src]
Get the TokenResponse data as a raw JSON Value. It is guaranteed to be of type Object.
pub fn access_token(&self) -> &str
[src]
Get the access token issued by the authorization server.
pub fn token_type(&self) -> &str
[src]
Get the type of token, described in RFC 6749 §7.1.
pub fn expires_in(&self) -> Option<i64>
[src]
Get the lifetime in seconds of the access token, if the authorization server provided one.
pub fn refresh_token(&self) -> Option<&str>
[src]
Get the refresh token, if the server provided one.
pub fn scope(&self) -> Option<&str>
[src]
Get the (space-separated) list of scopes associated with the access token. The authorization server is required to provide this if it differs from the requested set of scopes.
If scope
was not provided by the server as a string, this method will
return None
. For those providers, use `.as_value().get("scope")
instead.
Trait Implementations
impl Clone for TokenResponse
[src]
fn clone(&self) -> TokenResponse
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<TokenResponse> for TokenResponse
[src]
fn eq(&self, other: &TokenResponse) -> bool
[src]
fn ne(&self, other: &TokenResponse) -> bool
[src]
impl Debug for TokenResponse
[src]
impl TryFrom<Value> for TokenResponse
[src]
Auto Trait Implementations
impl Send for TokenResponse
impl Sync for TokenResponse
impl Unpin for TokenResponse
impl UnwindSafe for TokenResponse
impl RefUnwindSafe for TokenResponse
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,