Struct aws_sdk_s3::config::Builder[][src]

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

Builder for creating a Config.

Implementations

Constructs a config builder.

Sets the name of the app that is using the client.

This optional name is used to identify the application in the user agent that gets sent along with requests.

Sets the name of the app that is using the client.

This optional name is used to identify the application in the user agent that gets sent along with requests.

Set the timeout_config for the builder

Examples
use aws_sdk_s3::config::Config;
use aws_smithy_types::timeout::TimeoutConfig;

let timeout_config = TimeoutConfig::new()
    .with_api_call_attempt_timeout(Some(Duration::from_secs(1)));
let config = Config::builder().timeout_config(timeout_config).build();

Set the timeout_config for the builder

Examples
use aws_sdk_s3::config::{Builder, Config};
use aws_smithy_types::timeout::TimeoutConfig;

fn set_request_timeout(builder: &mut Builder) {
    let timeout_config = TimeoutConfig::new()
        .with_api_call_timeout(Some(Duration::from_secs(3)));
    builder.set_timeout_config(Some(timeout_config));
}

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

Set the sleep_impl for the builder

Examples
use aws_sdk_s3::config::Config;
use aws_smithy_async::rt::sleep::AsyncSleep;
use aws_smithy_async::rt::sleep::Sleep;

#[derive(Debug)]
pub struct ForeverSleep;

impl AsyncSleep for ForeverSleep {
    fn sleep(&self, duration: std::time::Duration) -> Sleep {
        Sleep::new(std::future::pending())
    }
}

let sleep_impl = std::sync::Arc::new(ForeverSleep);
let config = Config::builder().sleep_impl(sleep_impl).build();

Set the sleep_impl for the builder

Examples
use aws_sdk_s3::config::{Builder, Config};
use aws_smithy_async::rt::sleep::AsyncSleep;
use aws_smithy_async::rt::sleep::Sleep;

#[derive(Debug)]
pub struct ForeverSleep;

impl AsyncSleep for ForeverSleep {
    fn sleep(&self, duration: std::time::Duration) -> Sleep {
        Sleep::new(std::future::pending())
    }
}

fn set_never_ending_sleep_impl(builder: &mut Builder) {
    let sleep_impl = std::sync::Arc::new(ForeverSleep);
    builder.set_sleep_impl(Some(sleep_impl));
}

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

Set the retry_config for the builder

Examples
use aws_sdk_s3::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_sdk_s3::config::{Builder, Config};
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();

Sets the endpoint resolver to use when making requests.

Sets the AWS region to use when making requests.

Sets the credentials provider for this service

Sets the credentials provider for this service

Builds a Config.

Trait Implementations

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

Performs the conversion.

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