Struct aws_sdk_athena::config::retry::RetryConfigBuilder
source · #[non_exhaustive]pub struct RetryConfigBuilder { /* private fields */ }
Expand description
Builder for RetryConfig
.
Implementations§
source§impl RetryConfigBuilder
impl RetryConfigBuilder
sourcepub fn new() -> RetryConfigBuilder
pub fn new() -> RetryConfigBuilder
Creates a new builder.
sourcepub fn set_mode(
&mut self,
retry_mode: Option<RetryMode>
) -> &mut RetryConfigBuilder
pub fn set_mode( &mut self, retry_mode: Option<RetryMode> ) -> &mut RetryConfigBuilder
Sets the retry mode.
sourcepub fn mode(self, mode: RetryMode) -> RetryConfigBuilder
pub fn mode(self, mode: RetryMode) -> RetryConfigBuilder
Sets the retry mode.
sourcepub fn set_max_attempts(
&mut self,
max_attempts: Option<u32>
) -> &mut RetryConfigBuilder
pub fn set_max_attempts( &mut self, max_attempts: Option<u32> ) -> &mut RetryConfigBuilder
Sets the max attempts. This value must be greater than zero.
sourcepub fn max_attempts(self, max_attempts: u32) -> RetryConfigBuilder
pub fn max_attempts(self, max_attempts: u32) -> RetryConfigBuilder
Sets the max attempts. This value must be greater than zero.
sourcepub fn set_initial_backoff(
&mut self,
initial_backoff: Option<Duration>
) -> &mut RetryConfigBuilder
pub fn set_initial_backoff( &mut self, initial_backoff: Option<Duration> ) -> &mut RetryConfigBuilder
Set the initial_backoff duration. This duration should be non-zero.
sourcepub fn initial_backoff(self, initial_backoff: Duration) -> RetryConfigBuilder
pub fn initial_backoff(self, initial_backoff: Duration) -> RetryConfigBuilder
Set the initial_backoff duration. This duration should be non-zero.
sourcepub fn take_unset_from(self, other: RetryConfigBuilder) -> RetryConfigBuilder
pub fn take_unset_from(self, other: RetryConfigBuilder) -> RetryConfigBuilder
Merge 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 = RetryConfigBuilder::new().max_attempts(1);
let b = RetryConfigBuilder::new().max_attempts(5).mode(RetryMode::Adaptive);
let retry_config = a.take_unset_from(b).build();
// A's value take precedence over B's value
assert_eq!(retry_config.max_attempts(), 1);
// A never set a retry mode so B's value was used
assert_eq!(retry_config.mode(), RetryMode::Adaptive);
sourcepub fn build(self) -> RetryConfig
pub fn build(self) -> RetryConfig
Builds a RetryConfig
.
Trait Implementations§
source§impl Clone for RetryConfigBuilder
impl Clone for RetryConfigBuilder
source§fn clone(&self) -> RetryConfigBuilder
fn clone(&self) -> RetryConfigBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RetryConfigBuilder
impl Debug for RetryConfigBuilder
source§impl Default for RetryConfigBuilder
impl Default for RetryConfigBuilder
source§fn default() -> RetryConfigBuilder
fn default() -> RetryConfigBuilder
Returns the “default value” for a type. Read more
source§impl PartialEq<RetryConfigBuilder> for RetryConfigBuilder
impl PartialEq<RetryConfigBuilder> for RetryConfigBuilder
source§fn eq(&self, other: &RetryConfigBuilder) -> bool
fn eq(&self, other: &RetryConfigBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.