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§
fn bearer(&self) -> BoxFuture<'_, Result<SecretString>>
Called once after a 401; Ok(true) means a fresh credential is ready and the request is retried.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".