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§

source

fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>
where Self: 'a,

Returns a future that provides credentials.

Provided Methods§

source

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§

impl AsRef<dyn ProvideCredentials> for SharedCredentialsProvider

source§

fn as_ref(&self) -> &(dyn ProvideCredentials + 'static)

Converts this type into a shared reference of the (usually inferred) input type.

Implementations on Foreign Types§

source§

impl ProvideCredentials for Arc<dyn ProvideCredentials>

Implementors§