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>>

source§

impl<S> GetToken for Authenticator<S>
where S: Service<Uri> + Clone + Send + Sync + 'static, S::Response: Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static, S::Future: Send + Unpin + 'static, S::Error: Into<Box<dyn Error + Send + Sync>>,

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§