Struct aws_config::TimeoutConfig
source · [−]pub struct TimeoutConfig { /* private fields */ }
Expand description
Configuration for timeouts
Example
use aws_smithy_types::timeout::TimeoutConfig;
let timeout_config = TimeoutConfig::new()
.with_api_call_timeout(Some(Duration::from_secs(2)))
.with_api_call_attempt_timeout(Some(Duration::from_secs_f32(0.5)));
assert_eq!(
timeout_config.api_call_timeout(),
Some(Duration::from_secs(2))
);
assert_eq!(
timeout_config.api_call_attempt_timeout(),
Some(Duration::from_secs_f32(0.5))
);
Implementations
Returns true if any of the possible timeouts are set
Create a new TimeoutConfig
with no timeouts set
A limit on the amount of time after making an initial connect attempt on a socket to complete the connect-handshake.
A limit on the amount of time a TLS handshake takes from when the CLIENT HELLO
message is
sent to the time the client and server have fully negotiated ciphers and exchanged keys.
A limit on the amount of time an application takes to attempt to read the first byte over an established, open connection after write request. This is also known as the “time to first byte” timeout.
A limit on the amount of time it takes for the first byte to be sent over an established,
open connection and when the last byte is received from the service for a single attempt.
If you want to set a timeout for an entire request including retry attempts,
use TimeoutConfig::api_call_timeout
instead.
A limit on the amount of time it takes for request to complete. A single request may be
comprised of several attemps depending on an app’s RetryConfig
. If you want
to control timeouts for a single attempt, use TimeoutConfig::api_call_attempt_timeout
.
Consume a TimeoutConfig
to create a new one, setting the connect timeout
Consume a TimeoutConfig
to create a new one, setting the TLS negotiation timeout
Consume a TimeoutConfig
to create a new one, setting the read timeout
Consume a TimeoutConfig
to create a new one, setting the API call attempt timeout
Consume a TimeoutConfig
to create a new one, setting the API call timeout
Merges two builders together.
Values from other
will only be used as a fallback for values
from self
. Useful for merging configs from different sources together when you want to
handle “precedence” per value instead of at the config level
Example
let a = TimeoutConfig::new().with_read_timeout(Some(Duration::from_secs(2)));
let b = TimeoutConfig::new()
.with_read_timeout(Some(Duration::from_secs(10)))
.with_connect_timeout(Some(Duration::from_secs(3)));
let timeout_config = a.take_unset_from(b);
// A's value take precedence over B's value
assert_eq!(timeout_config.read_timeout(), Some(Duration::from_secs(2)));
// A never set a connect timeout so B's value was used
assert_eq!(timeout_config.connect_timeout(), Some(Duration::from_secs(3)));
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for TimeoutConfig
impl Send for TimeoutConfig
impl Sync for TimeoutConfig
impl Unpin for TimeoutConfig
impl UnwindSafe for TimeoutConfig
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