Struct aws_smithy_types::retry::RetryConfigBuilder
source · [−]#[non_exhaustive]pub struct RetryConfigBuilder { /* private fields */ }
Expand description
Builder for RetryConfig
.
Implementations
sourceimpl RetryConfigBuilder
impl RetryConfigBuilder
sourcepub fn set_max_attempts(&mut self, max_attempts: Option<u32>) -> &mut Self
pub fn set_max_attempts(&mut self, max_attempts: Option<u32>) -> &mut Self
Sets the max attempts. This value must be greater than zero.
sourcepub fn max_attempts(self, max_attempts: u32) -> Self
pub fn max_attempts(self, max_attempts: u32) -> Self
Sets the max attempts. This value must be greater than zero.
sourcepub fn take_unset_from(self, other: Self) -> Self
pub fn take_unset_from(self, other: Self) -> Self
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
sourceimpl Clone for RetryConfigBuilder
impl Clone for RetryConfigBuilder
sourcefn clone(&self) -> RetryConfigBuilder
fn clone(&self) -> RetryConfigBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RetryConfigBuilder
impl Debug for RetryConfigBuilder
sourceimpl Default for RetryConfigBuilder
impl Default for RetryConfigBuilder
sourcefn default() -> RetryConfigBuilder
fn default() -> RetryConfigBuilder
Returns the “default value” for a type. Read more
sourceimpl PartialEq<RetryConfigBuilder> for RetryConfigBuilder
impl PartialEq<RetryConfigBuilder> for RetryConfigBuilder
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RetryConfigBuilder) -> bool
fn ne(&self, other: &RetryConfigBuilder) -> bool
This method tests for !=
.
impl StructuralPartialEq for RetryConfigBuilder
Auto Trait Implementations
impl RefUnwindSafe for RetryConfigBuilder
impl Send for RetryConfigBuilder
impl Sync for RetryConfigBuilder
impl Unpin for RetryConfigBuilder
impl UnwindSafe for RetryConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more