Trait Token

Source
pub trait Token<L: Lifetime>: FromResponse {
    // Required methods
    fn access_token(&self) -> &str;
    fn scope(&self) -> Option<&str>;
    fn lifetime(&self) -> &L;
}
Expand description

OAuth 2.0 tokens.

See RFC 6749, section 5.

Required Methods§

Source

fn access_token(&self) -> &str

Returns the access token.

See RF C6749, section 1.4.

Source

fn scope(&self) -> Option<&str>

Returns the scope, if available.

Source

fn lifetime(&self) -> &L

Returns the token lifetime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<L: Lifetime> Token<L> for Bearer<L>