Struct fractal_api::oauth::AccessToken [] [src]

pub struct AccessToken {
    // some fields omitted
}

Struct representing an access token.

Methods

impl AccessToken
[src]

fn from_data(app_id: String, scopes: Vec<Scope>, access_token: String, token_type: TokenTypeDTO, expiration: DateTime<UTC>) -> AccessToken

Creates an access token from stored data.

fn get_app_id(&self) -> &str

Gets the application ID of the token.

fn scopes(&self) -> Iter<Scope>

Gets an iterator through the scopes of the token.

fn as_str(&self) -> &str

Gets the token as a string.

This string will be the one that identifies the client in the API.

fn get_token_type(&self) -> TokenType

Gets the type of the token.

fn get_expiration(&self) -> DateTime<UTC>

Gets the expiration time of the token.

fn has_expired(&self) -> bool

Returns wether the access token expired or not.

Trait Implementations

impl Clone for AccessToken
[src]

fn clone(&self) -> AccessToken

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Debug for AccessToken
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl FromDTO<AccessTokenDTO> for AccessToken
[src]

fn from_dto(dto: AccessTokenDTO) -> StdResult<AccessToken, FromDTOError>