Struct aws_sdk_cognitoidentityprovider::config::Builder [−][src]
pub struct Builder { /* fields omitted */ }
Expand description
Builder for creating a Config
.
Implementations
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_cognitoidentityprovider::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_cognitoidentityprovider::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_cognitoidentityprovider::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_cognitoidentityprovider::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_cognitoidentityprovider::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_cognitoidentityprovider::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.
Examples
use aws_types::region::Region;
use aws_sdk_cognitoidentityprovider::config::{Builder, Config};
let config = aws_sdk_cognitoidentityprovider::Config::builder()
.region(Region::new("us-east-1"))
.build();
pub fn credentials_provider(
self,
credentials_provider: impl ProvideCredentials + 'static
) -> Self
pub fn credentials_provider(
self,
credentials_provider: impl ProvideCredentials + 'static
) -> Self
Sets the credentials provider for this service
pub fn set_credentials_provider(
&mut self,
credentials_provider: Option<SharedCredentialsProvider>
) -> &mut Self
pub fn set_credentials_provider(
&mut self,
credentials_provider: Option<SharedCredentialsProvider>
) -> &mut Self
Sets the credentials provider for this service
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Builder
impl !UnwindSafe for Builder
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