Struct aws_config::meta::credentials::lazy_caching::Builder[][src]

pub struct Builder { /* fields omitted */ }
Expand description

Builder for constructing a LazyCachingCredentialsProvider.

Examples

use aws_types::Credentials;
use aws_config::meta::credentials::provide_credentials_fn;
use aws_config::meta::credentials::LazyCachingCredentialsProvider;

let provider = LazyCachingCredentialsProvider::builder()
    .load(provide_credentials_fn(|| async {
        // An async process to retrieve credentials would go here:
        Ok(Credentials::from_keys("example", "example", None))
    }))
    .build();

Implementations

Creates a new builder

Override configuration for the Builder

An implementation of ProvideCredentials that will be used to load the cached credentials once they’re expired.

Implementation of AsyncSleep to use for timeouts. This enables use of the LazyCachingCredentialsProvider with other async runtimes. If using Tokio as the async runtime, this should be set to an instance of TokioSleep.

(Optional) Timeout for the given ProvideCredentials implementation. Defaults to 5 seconds.

(Optional) Amount of time before the actual credential expiration time where credentials are considered expired. For example, if credentials are expiring in 15 minutes, and the buffer time is 10 seconds, then any requests made after 14 minutes and 50 seconds will load new credentials. Defaults to 10 seconds.

(Optional) Default expiration time to set on credentials if they don’t have an expiration time. This is only used if the given ProvideCredentials returns Credentials that don’t have their expiry set. This must be at least 15 minutes.

Creates the LazyCachingCredentialsProvider.

Panics

This will panic if no sleep implementation is given and if no default crate features are used. By default, the TokioSleep implementation will be set automatically.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more