Struct aws_sdk_rust::aws::common::credentials::ProfileProvider
[−]
[src]
pub struct ProfileProvider { /* fields omitted */ }
Provides AWS credentials from a profile in a credentials file.
The credentials file is located in the home directory of the given user by default.
You can change the default
profile by calling set_profile
.
Methods
impl ProfileProvider
[src]
fn new() -> Result<ProfileProvider, CredentialsError>
Create a new ProfileProvider
for the default credentials file path and profile name.
More details on the AWS credentials file can be found at AWS. Linux or Mac OS - ~/.aws/credentials Windows - %USERPROFILE%.aws\credentials
Sets the "default" credentials but can be overridden with set_profile.
fn with_profile<F, P>(location: F, profile: P) -> ProfileProvider where
F: Into<PathBuf>,
P: Into<String>,
F: Into<PathBuf>,
P: Into<String>,
Create a new ProfileProvider
for the credentials file at the given path, using
the given profile.
fn location(&self) -> &Path
Get a reference to the credentials location.
fn profile(&self) -> &str
Get a reference to the profile name. Profile name is the subsection in the credentials file. See AWS for details.
fn set_location<F>(&mut self, location: F) where
F: Into<PathBuf>,
F: Into<PathBuf>,
Set the credentials location.
fn set_profile<P>(&mut self, profile: P) where
P: Into<String>,
P: Into<String>,
Set the profile name. [default] is the profile that is used by default
. However,
you can set_profile
with the name that matches a named profile in your credentials
file and those credentials will be used.
Trait Implementations
impl Clone for ProfileProvider
[src]
fn clone(&self) -> ProfileProvider
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for ProfileProvider
[src]
impl AwsCredentialsProvider for ProfileProvider
[src]
fn credentials(&self) -> Result<AwsCredentials, CredentialsError>
Produce a new AwsCredentials
.