Struct aws_config::RetryConfig
source · [−]#[non_exhaustive]pub struct RetryConfig { /* private fields */ }
Expand description
Retry configuration for requests.
Implementations
sourceimpl RetryConfig
impl RetryConfig
sourcepub fn new() -> RetryConfig
pub fn new() -> RetryConfig
Creates a default RetryConfig
with RetryMode::Standard
and max attempts of three.
sourcepub fn disabled() -> RetryConfig
pub fn disabled() -> RetryConfig
Creates a RetryConfig
that has retries disabled.
sourcepub fn with_retry_mode(self, retry_mode: RetryMode) -> RetryConfig
pub fn with_retry_mode(self, retry_mode: RetryMode) -> RetryConfig
Set this config’s retry mode.
sourcepub fn with_max_attempts(self, max_attempts: u32) -> RetryConfig
pub fn with_max_attempts(self, max_attempts: u32) -> RetryConfig
Set the maximum number of times a request should be tried, including the initial attempt. This value must be greater than zero.
sourcepub fn with_initial_backoff(self, initial_backoff: Duration) -> RetryConfig
pub fn with_initial_backoff(self, initial_backoff: Duration) -> RetryConfig
Set the multiplier used when calculating backoff times as part of an exponential backoff with jitter strategy. Most services should work fine with the default duration of 1 second, but if you find that your requests are taking too long due to excessive retry backoff, try lowering this value.
Example
For a request that gets retried 3 times, when initial_backoff is 1 seconds:
- the first retry will occur after 0 to 1 seconds
- the second retry will occur after 0 to 2 seconds
- the third retry will occur after 0 to 4 seconds
For a request that gets retried 3 times, when initial_backoff is 30 milliseconds:
- the first retry will occur after 0 to 30 milliseconds
- the second retry will occur after 0 to 60 milliseconds
- the third retry will occur after 0 to 120 milliseconds
sourcepub fn max_attempts(&self) -> u32
pub fn max_attempts(&self) -> u32
Returns the max attempts.
sourcepub fn initial_backoff(&self) -> Duration
pub fn initial_backoff(&self) -> Duration
Returns the backoff multiplier duration.
Trait Implementations
sourceimpl Clone for RetryConfig
impl Clone for RetryConfig
sourcefn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
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 RetryConfig
impl Debug for RetryConfig
sourceimpl Default for RetryConfig
impl Default for RetryConfig
sourcefn default() -> RetryConfig
fn default() -> RetryConfig
Returns the “default value” for a type. Read more
sourceimpl PartialEq<RetryConfig> for RetryConfig
impl PartialEq<RetryConfig> for RetryConfig
sourcefn eq(&self, other: &RetryConfig) -> bool
fn eq(&self, other: &RetryConfig) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RetryConfig) -> bool
fn ne(&self, other: &RetryConfig) -> bool
This method tests for !=
.
impl StructuralPartialEq for RetryConfig
Auto Trait Implementations
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnwindSafe for RetryConfig
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more