Struct aws_config::meta::region::RegionProviderChain [−][src]
pub struct RegionProviderChain { /* fields omitted */ }
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
fn region(&self) -> ProvideRegion<'_>ⓘNotable traits for ProvideRegion<'_>impl Future for ProvideRegion<'_> type Output = Option<Region>;
fn region(&self) -> ProvideRegion<'_>ⓘNotable traits for ProvideRegion<'_>impl Future for ProvideRegion<'_> type Output = Option<Region>;
Notable traits for ProvideRegion<'_>
impl Future for ProvideRegion<'_> type Output = Option<Region>;
Load a region from this provider
Auto Trait Implementations
impl !RefUnwindSafe for RegionProviderChain
impl Send for RegionProviderChain
impl Sync for RegionProviderChain
impl Unpin for RegionProviderChain
impl !UnwindSafe for RegionProviderChain
Blanket Implementations
Mutably borrows from an owned value. Read more
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