pub trait ProvideCredentials:
Send
+ Sync
+ Debug {
// Required method
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>
where Self: 'a;
// Provided method
fn fallback_on_interrupt(&self) -> Option<Credentials> { ... }
}
Expand description
Asynchronous Credentials Provider
Required Methods§
Sourcefn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where
Self: 'a,
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where
Self: 'a,
Returns a future that provides credentials.
Provided Methods§
Sourcefn fallback_on_interrupt(&self) -> Option<Credentials>
fn fallback_on_interrupt(&self) -> Option<Credentials>
Returns fallback credentials.
This method should be used as a fallback plan, i.e., when
a call to provide_credentials
is interrupted and its future
fails to complete.
The fallback credentials should be set aside and ready to be returned immediately. Therefore, the user should NOT go fetch new credentials within this method, which might cause a long-running operation.
Trait Implementations§
Source§fn as_ref(&self) -> &(dyn ProvideCredentials + 'static)
fn as_ref(&self) -> &(dyn ProvideCredentials + 'static)
Converts this type into a shared reference of the (usually inferred) input type.