Struct rusoto_credential::ProfileProvider
source · pub struct ProfileProvider { /* private fields */ }
Expand description
Provides AWS credentials from a profile in a credentials file.
Implementations
sourceimpl ProfileProvider
impl ProfileProvider
sourcepub fn new() -> Result<ProfileProvider, CredentialsError>
pub fn new() -> Result<ProfileProvider, CredentialsError>
Create a new ProfileProvider
for the default credentials file path and profile name.
sourcepub fn with_configuration<F, P>(file_path: F, profile: P) -> ProfileProviderwhere
F: Into<PathBuf>,
P: Into<String>,
pub fn with_configuration<F, P>(file_path: F, profile: P) -> ProfileProviderwhere
F: Into<PathBuf>,
P: Into<String>,
Create a new ProfileProvider
for the credentials file at the given path, using
the given profile.
sourcepub fn with_default_configuration<F>(file_path: F) -> ProfileProviderwhere
F: Into<PathBuf>,
pub fn with_default_configuration<F>(file_path: F) -> ProfileProviderwhere
F: Into<PathBuf>,
Create a new ProfileProvider
for the credentials file at the given path, using
the profile name from environment variable AWS_PROFILE
or fall-back to "default"
if AWS_PROFILE
is not set.
sourcepub fn region() -> Result<Option<String>, CredentialsError>
pub fn region() -> Result<Option<String>, CredentialsError>
Attempts to resolve a region value associated with the current profile from
~/.aws/config
or the file associated with the AWS_CONFIG_FILE
environment variable.
As these fields do not require a region field to be defined, an Option
type is returned
For a the ful region resolution chain, use the Default
impl for rusoto_core::Region
sourcepub fn set_file_path<F>(&mut self, file_path: F)where
F: Into<PathBuf>,
pub fn set_file_path<F>(&mut self, file_path: F)where
F: Into<PathBuf>,
Set the credentials file path.
sourcepub fn set_profile<P>(&mut self, profile: P)where
P: Into<String>,
pub fn set_profile<P>(&mut self, profile: P)where
P: Into<String>,
Set the profile name.
Trait Implementations
sourceimpl Clone for ProfileProvider
impl Clone for ProfileProvider
sourcefn clone(&self) -> ProfileProvider
fn clone(&self) -> ProfileProvider
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ProfileProvider
impl Debug for ProfileProvider
sourceimpl ProvideAwsCredentials for ProfileProvider
impl ProvideAwsCredentials for ProfileProvider
type Future = ProfileProviderFuture
type Future = ProfileProviderFuture
sourcefn credentials(&self) -> Self::Future
fn credentials(&self) -> Self::Future
AwsCredentials
future.