pub struct RegionProviderChain { /* private fields */ }
Expand description

Load a region by selecting the first from a series of region providers.

Examples

use aws_types::region::Region;
use std::env;
use aws_config::meta::region::RegionProviderChain;

// region provider that first checks the `CUSTOM_REGION` environment variable,
// then checks the default provider chain, then falls back to us-east-2
let provider = RegionProviderChain::first_try(env::var("CUSTOM_REGION").ok().map(Region::new))
    .or_default_provider()
    .or_else(Region::new("us-east-2"));

Implementations§

Load a region from the provider chain

The first provider to return a non-optional region will be selected

Create a default provider chain that starts by checking this provider.

Add a fallback provider to the region provider chain.

Create a region provider chain that starts by checking the default provider.

Fallback to the default provider

Trait Implementations§

Formats the value using the given formatter. Read more
Load a region from this provider

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
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