pub struct ProfileCredentialProvider { /* private fields */ }Expand description
ProfileCredentialProvider loads AWS credentials from configuration files.
This provider loads credentials from:
~/.aws/credentials(or the path specified byAWS_SHARED_CREDENTIALS_FILE)~/.aws/config(or the path specified byAWS_CONFIG_FILE)
The profile to use is determined by:
- The profile specified via
with_profile() - The
AWS_PROFILEenvironment variable - Default to “default”
Implementations§
Source§impl ProfileCredentialProvider
impl ProfileCredentialProvider
Sourcepub fn with_profile(self, profile: impl Into<String>) -> Self
pub fn with_profile(self, profile: impl Into<String>) -> Self
Set the profile name to use.
Sourcepub fn with_config_file(self, path: impl Into<String>) -> Self
pub fn with_config_file(self, path: impl Into<String>) -> Self
Set the path to the config file.
Sourcepub fn with_credentials_file(self, path: impl Into<String>) -> Self
pub fn with_credentials_file(self, path: impl Into<String>) -> Self
Set the path to the credentials file.
Trait Implementations§
Source§impl Clone for ProfileCredentialProvider
impl Clone for ProfileCredentialProvider
Source§fn clone(&self) -> ProfileCredentialProvider
fn clone(&self) -> ProfileCredentialProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProfileCredentialProvider
impl Debug for ProfileCredentialProvider
Source§impl Default for ProfileCredentialProvider
impl Default for ProfileCredentialProvider
Source§impl ProvideCredential for ProfileCredentialProvider
impl ProvideCredential for ProfileCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Credential returned by this loader. Read more
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Load signing credential from current env.
Auto Trait Implementations§
impl Freeze for ProfileCredentialProvider
impl RefUnwindSafe for ProfileCredentialProvider
impl Send for ProfileCredentialProvider
impl Sync for ProfileCredentialProvider
impl Unpin for ProfileCredentialProvider
impl UnsafeUnpin for ProfileCredentialProvider
impl UnwindSafe for ProfileCredentialProvider
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
Source§type Credential = <T as ProvideCredential>::Credential
type Credential = <T as ProvideCredential>::Credential
Credential returned by this loader.
Source§fn provide_credential_dyn<'a>(
&'a self,
ctx: &'a Context,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
fn provide_credential_dyn<'a>( &'a self, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
Dyn version of
ProvideCredential::provide_credential.