pub trait GetToken: GetTokenClone + Send + Sync {
    // Required method
    fn get_token<'a>(
        &'a self,
        _scopes: &'a [&str]
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>;
}

Required Methods§

source

fn get_token<'a>( &'a self, _scopes: &'a [&str] ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Called whenever an API call requires authentication via an oauth2 token. Returns Ok(None) if a token is not necessary - otherwise, returns an error indicating the reason why a token could not be produced.

Trait Implementations§

source§

impl Clone for Box<dyn GetToken>

source§

fn clone(&self) -> Box<dyn GetToken>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Implementations on Foreign Types§

source§

impl GetToken for String

source§

fn get_token<'a>( &'a self, _scopes: &'a [&str] ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>

Implementors§