Struct aws_types::config::Builder[][src]

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

Builder for AWS Shared Configuration

Implementations

Set the region for the builder

Examples
use aws_types::config::Config;
use aws_types::region::Region;
let config = Config::builder().region(Region::new("us-east-1")).build();

Set the region for the builder

Examples
fn region_override() -> Option<Region> {
    // ...
}
use aws_types::config::Config;
use aws_types::region::Region;
let mut builder = Config::builder();
if let Some(region) = region_override() {
    builder.set_region(region);
}
let config = builder.build();

Set the retry_config for the builder

Examples
use aws_types::config::Config;
use aws_smithy_types::retry::RetryConfig;

let retry_config = RetryConfig::new().with_max_attempts(5);
let config = Config::builder().retry_config(retry_config).build();

Set the retry_config for the builder

Examples
use aws_types::config::{Config, Builder};
use aws_smithy_types::retry::RetryConfig;

fn disable_retries(builder: &mut Builder) {
    let retry_config = RetryConfig::new().with_max_attempts(1);
    builder.set_retry_config(Some(retry_config));
}

let mut builder = Config::builder();
disable_retries(&mut builder);
let config = builder.build();

Set the credentials provider for the builder

Examples
use aws_types::credentials::{ProvideCredentials, SharedCredentialsProvider};
use aws_types::config::Config;
fn make_provider() -> impl ProvideCredentials {
  // ...
}

let config = Config::builder()
    .credentials_provider(SharedCredentialsProvider::new(make_provider()))
    .build();

Set the credentials provider for the builder

Examples
use aws_types::credentials::{ProvideCredentials, SharedCredentialsProvider};
use aws_types::config::Config;
fn make_provider() -> impl ProvideCredentials {
  // ...
}

fn override_provider() -> bool {
  // ...
}

let mut builder = Config::builder();
if override_provider() {
    builder.set_credentials_provider(Some(SharedCredentialsProvider::new(make_provider())));
}
let config = builder.build();

Build a Config from this builder

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.

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.