pub struct ExponentialRetryOptions {
    pub initial_delay: Duration,
    pub max_retries: u32,
    pub max_total_elapsed: Duration,
    pub max_delay: Duration,
}Expand description
Options for how an exponential retry strategy should behave.
§Example
Configuring retry to be exponential with 10 retries max and an initial delay of 1 second.
RetryOptions::exponential(
   ExponentialRetryOptions::default()
       .max_retries(10u32)
       .initial_delay(Duration::from_secs(1)),
);Fields§
§initial_delay: DurationThe initial delay between retry attempts. The delay will increase with each retry.
The default is 200 milliseconds.
max_retries: u32The maximum number of retry attempts before giving up.
The default is 8.
max_total_elapsed: DurationThe maximum permissible elapsed time since starting to retry before giving up.
The default is 1 minute.
max_delay: DurationThe maximum permissible time between retries.
The default is 30 seconds. For SRE reasons, this is only respected when above 1 second.
Implementations§
Trait Implementations§
Source§impl Clone for ExponentialRetryOptions
 
impl Clone for ExponentialRetryOptions
Source§fn clone(&self) -> ExponentialRetryOptions
 
fn clone(&self) -> ExponentialRetryOptions
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 ExponentialRetryOptions
 
impl Debug for ExponentialRetryOptions
Auto Trait Implementations§
impl Freeze for ExponentialRetryOptions
impl RefUnwindSafe for ExponentialRetryOptions
impl Send for ExponentialRetryOptions
impl Sync for ExponentialRetryOptions
impl Unpin for ExponentialRetryOptions
impl UnwindSafe for ExponentialRetryOptions
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more