Struct aws_credential_types::cache::CredentialsCache
source · pub struct CredentialsCache { /* private fields */ }
Expand description
CredentialsCache
allows for configuring and creating a credentials cache.
Examples
use aws_credential_types::Credentials;
use aws_credential_types::cache::CredentialsCache;
use aws_credential_types::credential_fn::provide_credentials_fn;
use aws_credential_types::provider::SharedCredentialsProvider;
let credentials_cache = CredentialsCache::lazy_builder()
.into_credentials_cache()
.create_cache(SharedCredentialsProvider::new(provide_credentials_fn(|| async {
// An async process to retrieve credentials would go here:
Ok(Credentials::new(
"example",
"example",
None,
None,
"my_provider_name"
))
})));
Implementations§
source§impl CredentialsCache
impl CredentialsCache
sourcepub fn lazy() -> Self
pub fn lazy() -> Self
Creates a CredentialsCache
from the default LazyBuilder
.
sourcepub fn lazy_builder() -> LazyBuilder
pub fn lazy_builder() -> LazyBuilder
Returns the default LazyBuilder
.
sourcepub fn create_cache(
self,
provider: SharedCredentialsProvider
) -> SharedCredentialsCache
pub fn create_cache( self, provider: SharedCredentialsProvider ) -> SharedCredentialsCache
Creates a SharedCredentialsCache
wrapping a concrete caching implementation.
Trait Implementations§
source§impl Clone for CredentialsCache
impl Clone for CredentialsCache
source§fn clone(&self) -> CredentialsCache
fn clone(&self) -> CredentialsCache
Returns a copy 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 moreAuto Trait Implementations§
impl !RefUnwindSafe for CredentialsCache
impl Send for CredentialsCache
impl Sync for CredentialsCache
impl Unpin for CredentialsCache
impl !UnwindSafe for CredentialsCache
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