Struct aws_config::meta::credentials::CredentialsProviderChain [−][src]
pub struct CredentialsProviderChain { /* fields omitted */ }
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_types::Credentials;
use aws_config::environment;
use aws_config::environment::credentials::EnvironmentVariableCredentialsProvider;
let provider = CredentialsProviderChain::first_try("Environment", EnvironmentVariableCredentialsProvider::new())
.or_else("Static", Credentials::from_keys("someacceskeyid", "somesecret", None));
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
Auto Trait Implementations
impl !RefUnwindSafe for CredentialsProviderChain
impl Send for CredentialsProviderChain
impl Sync for CredentialsProviderChain
impl Unpin for CredentialsProviderChain
impl !UnwindSafe for CredentialsProviderChain
Blanket Implementations
Mutably borrows from an owned value. Read more
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