#[non_exhaustive]pub struct TimeoutConfig { /* private fields */ }
Expand description
Top-level configuration for timeouts
§Example
use aws_smithy_types::timeout::TimeoutConfig;
let timeout_config = TimeoutConfig::builder()
.operation_timeout(Duration::from_secs(30))
.operation_attempt_timeout(Duration::from_secs(10))
.connect_timeout(Duration::from_secs(3))
.build();
assert_eq!(
timeout_config.operation_timeout(),
Some(Duration::from_secs(30))
);
assert_eq!(
timeout_config.operation_attempt_timeout(),
Some(Duration::from_secs(10))
);
assert_eq!(
timeout_config.connect_timeout(),
Some(Duration::from_secs(3))
);
Implementations§
Source§impl TimeoutConfig
impl TimeoutConfig
Sourcepub fn builder() -> TimeoutConfigBuilder
pub fn builder() -> TimeoutConfigBuilder
Returns a builder to create a TimeoutConfig
.
Sourcepub fn to_builder(&self) -> TimeoutConfigBuilder
pub fn to_builder(&self) -> TimeoutConfigBuilder
Returns a builder equivalent of this TimeoutConfig
.
Sourcepub fn into_builder(self) -> TimeoutConfigBuilder
pub fn into_builder(self) -> TimeoutConfigBuilder
Converts this TimeoutConfig
into a builder.
Sourcepub fn take_defaults_from(
&mut self,
other: &TimeoutConfig,
) -> &mut TimeoutConfig
pub fn take_defaults_from( &mut self, other: &TimeoutConfig, ) -> &mut TimeoutConfig
Fill any unfilled values in self
from other
.
Sourcepub fn disabled() -> TimeoutConfig
pub fn disabled() -> TimeoutConfig
Returns a timeout config with all timeouts disabled.
Sourcepub fn connect_timeout(&self) -> Option<Duration>
pub fn connect_timeout(&self) -> Option<Duration>
Returns this config’s connect timeout.
The connect timeout is a limit on the amount of time it takes to initiate a socket connection.
Sourcepub fn read_timeout(&self) -> Option<Duration>
pub fn read_timeout(&self) -> Option<Duration>
Returns this config’s read timeout.
The read timeout is the limit on the amount of time it takes to read the first byte of a response from the time the request is initiated.
Sourcepub fn operation_timeout(&self) -> Option<Duration>
pub fn operation_timeout(&self) -> Option<Duration>
Returns this config’s operation timeout.
An operation represents the full request/response lifecycle of a call to a service. The operation timeout is a limit on the total amount of time it takes for an operation to be fully serviced, including the time for all retries that may have been attempted for it.
Sourcepub fn operation_attempt_timeout(&self) -> Option<Duration>
pub fn operation_attempt_timeout(&self) -> Option<Duration>
Returns this config’s operation attempt timeout.
An operation represents the full request/response lifecycle of a call to a service. When retries are enabled, then this setting makes it possible to set a timeout for individual retry attempts (including the initial attempt) for an operation.
Sourcepub fn has_timeouts(&self) -> bool
pub fn has_timeouts(&self) -> bool
Returns true if any of the possible timeouts are set.
Trait Implementations§
Source§impl Clone for TimeoutConfig
impl Clone for TimeoutConfig
Source§fn clone(&self) -> TimeoutConfig
fn clone(&self) -> TimeoutConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TimeoutConfig
impl Debug for TimeoutConfig
Source§impl From<TimeoutConfig> for TimeoutConfigBuilder
impl From<TimeoutConfig> for TimeoutConfigBuilder
Source§fn from(timeout_config: TimeoutConfig) -> TimeoutConfigBuilder
fn from(timeout_config: TimeoutConfig) -> TimeoutConfigBuilder
Source§impl PartialEq for TimeoutConfig
impl PartialEq for TimeoutConfig
Source§impl Storable for TimeoutConfig
impl Storable for TimeoutConfig
Source§type Storer = StoreReplace<TimeoutConfig>
type Storer = StoreReplace<TimeoutConfig>
StoreReplace
and StoreAppend
impl StructuralPartialEq for TimeoutConfig
Auto Trait Implementations§
impl Freeze for TimeoutConfig
impl RefUnwindSafe for TimeoutConfig
impl Send for TimeoutConfig
impl Sync for TimeoutConfig
impl Unpin for TimeoutConfig
impl UnwindSafe for TimeoutConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)