Struct aws_config::ConfigLoader[][src]

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

Load a cross-service Config from the environment

This builder supports overriding individual components of the generated config. Overriding a component will skip the standard resolution chain from for that component. For example, if you override the region provider, even if that provider returns None, the default region provider chain will not be used.

Implementations

Override the region used to build Config.

Examples
use aws_types::region::Region;
let config = aws_config::from_env()
    .region(Region::new("us-east-1"))
    .load().await;

Override the retry_config used to build Config.

Examples
    let config = aws_config::from_env()
        .retry_config(RetryConfig::new().with_max_attempts(2))
        .load().await;

Override the credentials provider used to build Config.

Examples

Override the credentials provider but load the default value for region:

 async fn create_config() {
let config = aws_config::from_env()
    .credentials_provider(Credentials::from_keys("accesskey", "secretkey", None))
    .load().await;

Load the default configuration chain

If fields have been overridden during builder construction, the override values will be used.

Otherwise, the default values for each field will be provided.

NOTE: When an override is provided, the default implementation is not used as a fallback. This means that if you provide a region provider that does not return a region, no region will be set in the resulting Config

Trait Implementations

Formats the value using the given formatter. Read more

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