Skip to main content

TokenProvider

Trait TokenProvider 

Source
pub trait TokenProvider {
    type Token<'a>: Future<Output = Result<AccessToken>> + 'a
       where Self: 'a;

    // Required method
    fn token(&self) -> Self::Token<'_>;

    // Provided method
    fn quota_project(&self) -> Option<&str> { ... }
}
Expand description

A source of access tokens.

Required Associated Types§

Source

type Token<'a>: Future<Output = Result<AccessToken>> + 'a where Self: 'a

Future of token.

Required Methods§

Source

fn token(&self) -> Self::Token<'_>

A token valid for at least a minute (an empty secret sends no header).

Provided Methods§

Source

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

The project billed for API quota (user credentials only).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§