pub trait TokenProvider: Send + Sync {
// Required methods
fn authenticate<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Token>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn refresh<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 Token,
) -> Pin<Box<dyn Future<Output = Result<Token>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn login<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Token>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn can_authenticate_silently(&self) -> bool { ... }
}Expand description
Provider-specific acquisition; persistence and locking belong to AuthClient.
Required Methods§
Provided Methods§
Sourcefn login<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Token>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn login<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Token>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform an explicitly requested login; defaults to normal acquisition.
Sourcefn can_authenticate_silently(&self) -> bool
fn can_authenticate_silently(&self) -> bool
Whether acquisition is safe without an explicit interactive login request.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".