pub trait TokenCache: Sync {
    fn token_and_exp<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Option<(String, u64)>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn set_token<'life0, 'async_trait>(
        &'life0 self,
        token: String,
        exp: u64
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn scope<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn fetch_token<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: &'life1 Client
    ) -> Pin<Box<dyn Future<Output = Result<(String, u64)>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client: &'life1 Client
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Trait that refreshes a token when it is expired

Required Methods

Returns the token that is currently held within the instance of TokenCache, together with the expiry of that token as a u64 in seconds sine the Unix Epoch (1 Jan 1970).

Updates the token to the value token.

Returns the intended scope for the current token.

Fetches and returns the token using the service account

Provided Methods

Returns a valid, unexpired token. If the contained token is expired, it updates and returns the token.

Implementors