pub struct AwsCredentials { /* private fields */ }
Expand description
AWS API access credentials, including access key, secret key, token (for IAM profiles), expiration timestamp, and claims from federated login.
§Anonymous example
Some AWS services, like s3 do
not require authenticated credentials. For these cases you can use AwsCredentials::default
with StaticProvider
.
Implementations§
Source§impl AwsCredentials
impl AwsCredentials
Sourcepub fn new<K, S>(
key: K,
secret: S,
token: Option<String>,
expires_at: Option<DateTime<Utc>>,
) -> AwsCredentials
pub fn new<K, S>( key: K, secret: S, token: Option<String>, expires_at: Option<DateTime<Utc>>, ) -> AwsCredentials
Create a new AwsCredentials
from a key ID, secret key, optional access token, and expiry
time.
Sourcepub fn aws_access_key_id(&self) -> &str
pub fn aws_access_key_id(&self) -> &str
Get a reference to the access key ID.
Sourcepub fn aws_secret_access_key(&self) -> &str
pub fn aws_secret_access_key(&self) -> &str
Get a reference to the secret access key.
Sourcepub fn expires_at(&self) -> &Option<DateTime<Utc>>
pub fn expires_at(&self) -> &Option<DateTime<Utc>>
Get a reference to the expiry time.
Sourcepub fn claims_mut(&mut self) -> &mut BTreeMap<String, String>
pub fn claims_mut(&mut self) -> &mut BTreeMap<String, String>
Get the mutable token claims
Trait Implementations§
Source§impl Anonymous for AwsCredentials
impl Anonymous for AwsCredentials
Source§fn is_anonymous(&self) -> bool
fn is_anonymous(&self) -> bool
Return true if a type is anonymous, false otherwise
Source§impl Clone for AwsCredentials
impl Clone for AwsCredentials
Source§fn clone(&self) -> AwsCredentials
fn clone(&self) -> AwsCredentials
Returns a duplicate of the value. Read more
1.0.0 · 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 AwsCredentials
impl Debug for AwsCredentials
Source§impl Default for AwsCredentials
impl Default for AwsCredentials
Source§fn default() -> AwsCredentials
fn default() -> AwsCredentials
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AwsCredentials
impl<'de> Deserialize<'de> for AwsCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AwsCredentials> for StaticProvider
impl From<AwsCredentials> for StaticProvider
Source§fn from(credentials: AwsCredentials) -> Self
fn from(credentials: AwsCredentials) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AwsCredentials
impl RefUnwindSafe for AwsCredentials
impl Send for AwsCredentials
impl Sync for AwsCredentials
impl Unpin for AwsCredentials
impl UnwindSafe for AwsCredentials
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