Struct aws_config::meta::credentials::CredentialsProviderChain
source · 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§
source§impl CredentialsProviderChain
impl CredentialsProviderChain
Trait Implementations§
source§impl Debug for CredentialsProviderChain
impl Debug for CredentialsProviderChain
source§impl ProvideCredentials for CredentialsProviderChain
impl ProvideCredentials for CredentialsProviderChain
source§fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'_>where
Self: 'a,
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'_>where
Self: 'a,
Returns a future that provides credentials.
source§fn fallback_on_interrupt(&self) -> Option<Credentials>
fn fallback_on_interrupt(&self) -> Option<Credentials>
Returns fallback credentials. Read more
Auto Trait Implementations§
impl Freeze for CredentialsProviderChain
impl !RefUnwindSafe for CredentialsProviderChain
impl Send for CredentialsProviderChain
impl Sync for CredentialsProviderChain
impl Unpin for CredentialsProviderChain
impl !UnwindSafe for CredentialsProviderChain
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.