Skip to main content

OAuthTokens

Trait OAuthTokens 

Source
pub trait OAuthTokens: Send + Sync {
    // Required methods
    fn managed_scopes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        profile: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn refresh_token<'life0, 'life1, 'async_trait>(
        &'life0 self,
        profile: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn refresh_access_token_if_needed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        profile: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The OAuth tokens behind some auth profiles, kept fresh by the host.

Required Methods§

Source

fn managed_scopes<'life0, 'life1, 'async_trait>( &'life0 self, profile: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The scopes granted to profile when the host manages it as an OAuth connection, else None (the tool then never asks it to refresh).

Source

fn refresh_token<'life0, 'life1, 'async_trait>( &'life0 self, profile: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Refresh profile’s access token now; returns a short summary.

Source

fn refresh_access_token_if_needed<'life0, 'life1, 'async_trait>( &'life0 self, profile: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Refresh profile’s access token if it is about to expire; true when it did.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§