pub struct CredentialsProviderChain { /* private fields */ }
Expand description

Credentials provider that checks a series of inner providers

Each provider will be evaluated in order:

  • If a provider returns valid Credentials they will be returned immediately. No other credential providers will be used.
  • Otherwise, if a provider returns CredentialsError::CredentialsNotLoaded, the next provider will be checked.
  • Finally, if a provider returns any other error condition, an error will be returned immediately.

Examples

use aws_config::meta::credentials::CredentialsProviderChain;
use aws_config::environment::credentials::EnvironmentVariableCredentialsProvider;
use aws_config::profile::ProfileFileCredentialsProvider;

let provider = CredentialsProviderChain::first_try("Environment", EnvironmentVariableCredentialsProvider::new())
    .or_else("Profile", ProfileFileCredentialsProvider::builder().build());

Implementations§

Create a CredentialsProviderChain that begins by evaluating this provider

Add a fallback provider to the credentials provider chain

Add a fallback to the default provider chain

Creates a credential provider chain that starts with the default provider

Trait Implementations§

Formats the value using the given formatter. Read more
Returns a future that provides credentials.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more