pub struct Builder { /* private fields */ }
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_firehose::config::Config;
use aws_smithy_types::{timeout, tristate::TriState};

let api_timeouts = timeout::Api::new()
    .with_call_attempt_timeout(TriState::Set(Duration::from_secs(1)));
let timeout_config = timeout::Config::new()
    .with_api_timeouts(api_timeouts);
let config = Config::builder().timeout_config(timeout_config).build();

Set the timeout_config for the builder

Examples
use aws_sdk_firehose::config::{Builder, Config};
use aws_smithy_types::{timeout, tristate::TriState};

fn set_request_timeout(builder: &mut Builder) {
    let api_timeouts = timeout::Api::new()
        .with_call_attempt_timeout(TriState::Set(Duration::from_secs(1)));
    let timeout_config = timeout::Config::new()
        .with_api_timeouts(api_timeouts);
    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_firehose::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_firehose::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_firehose::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_firehose::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();

Overrides the endpoint resolver to use when making requests.

When unset, the client will used a generated endpoint resolver based on the endpoint metadata for aws_sdk_firehose.

Examples
use aws_types::region::Region;
use aws_sdk_firehose::config::{Builder, Config};
use aws_sdk_firehose::Endpoint;

let config = aws_sdk_firehose::Config::builder()
    .endpoint_resolver(
        Endpoint::immutable("http://localhost:8080".parse().expect("valid URI"))
    ).build();

Sets the endpoint resolver to use when making requests.

Sets the AWS region to use when making requests.

Examples
use aws_types::region::Region;
use aws_sdk_firehose::config::{Builder, Config};

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

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

Converts to this type from the input type.

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.

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