Struct Credentials
pub struct Credentials(/* private fields */);Expand description
AWS SDK Credentials
An opaque struct representing credentials that may be used in an AWS SDK, modeled on the CRT credentials implementation.
When Credentials is dropped, its contents are zeroed in memory. Credentials uses an interior Arc to ensure
that even when cloned, credentials don’t exist in multiple memory locations.
Implementations§
§impl Credentials
impl Credentials
pub fn builder() -> CredentialsBuilder
pub fn builder() -> CredentialsBuilder
Returns builder for Credentials.
pub fn new(
access_key_id: impl Into<String>,
secret_access_key: impl Into<String>,
session_token: Option<String>,
expires_after: Option<SystemTime>,
provider_name: &'static str,
) -> Credentials
pub fn new( access_key_id: impl Into<String>, secret_access_key: impl Into<String>, session_token: Option<String>, expires_after: Option<SystemTime>, provider_name: &'static str, ) -> Credentials
Creates Credentials.
This is intended to be used from a custom credentials provider implementation. It is NOT secure to hardcode credentials into your application.
pub fn access_key_id(&self) -> &str
pub fn access_key_id(&self) -> &str
Returns the access key ID.
pub fn secret_access_key(&self) -> &str
pub fn secret_access_key(&self) -> &str
Returns the secret access key.
pub fn expiry(&self) -> Option<SystemTime>
pub fn expiry(&self) -> Option<SystemTime>
Returns the time when the credentials will expire.
pub fn expiry_mut(&mut self) -> &mut Option<SystemTime>
pub fn expiry_mut(&mut self) -> &mut Option<SystemTime>
Returns a mutable reference to the time when the credentials will expire.
pub fn account_id(&self) -> Option<&AccountId>
pub fn account_id(&self) -> Option<&AccountId>
Returns the account ID.
pub fn session_token(&self) -> Option<&str>
pub fn session_token(&self) -> Option<&str>
Returns the session token.
§impl Credentials
impl Credentials
pub fn for_tests() -> Credentials
pub fn for_tests() -> Credentials
Creates a test Credentials with no session token.
pub fn for_tests_with_session_token() -> Credentials
pub fn for_tests_with_session_token() -> Credentials
Creates a test Credentials that include a session token.
Trait Implementations§
§impl Clone for Credentials
impl Clone for Credentials
§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for Credentials
impl Debug for Credentials
impl Eq for Credentials
§impl PartialEq for Credentials
impl PartialEq for Credentials
§impl ProvideCredentials for Credentials
impl ProvideCredentials for Credentials
§fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a> ⓘwhere
Credentials: 'a,
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a> ⓘwhere
Credentials: 'a,
§fn fallback_on_interrupt(&self) -> Option<Credentials>
fn fallback_on_interrupt(&self) -> Option<Credentials>
Auto Trait Implementations§
impl !RefUnwindSafe for Credentials
impl !UnwindSafe for Credentials
impl Freeze for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnsafeUnpin for Credentials
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more