Skip to main content

TokenSource

Trait TokenSource 

Source
pub trait TokenSource: Send + Sync {
    // Required methods
    fn bearer(&self) -> BoxFuture<'_, Result<SecretString>>;
    fn refresh_after_unauthorized(&self) -> BoxFuture<'_, Result<bool>>;
    fn label(&self) -> &str;
}
Expand description

Supplies the bearer credential for requests.

Required Methods§

Source

fn bearer(&self) -> BoxFuture<'_, Result<SecretString>>

Source

fn refresh_after_unauthorized(&self) -> BoxFuture<'_, Result<bool>>

Called once after a 401; Ok(true) means a fresh credential is ready and the request is retried.

Source

fn label(&self) -> &str

The profile name shown in errors.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§