pub struct MaxAttemptsRetryPolicy<T: RetryPolicy> { /* private fields */ }Expand description
Decorates the given RetryPolicy to respect the given maximum attempts.
Trait Implementations§
Source§impl<T: RetryPolicy> RetryPolicy for MaxAttemptsRetryPolicy<T>
impl<T: RetryPolicy> RetryPolicy for MaxAttemptsRetryPolicy<T>
Source§type E = <T as RetryPolicy>::E
type E = <T as RetryPolicy>::E
The error type returned by the
operation in retry.Source§fn next_delay(&self, context: &RetryContext<'_, Self::E>) -> Option<Duration>
fn next_delay(&self, context: &RetryContext<'_, Self::E>) -> Option<Duration>
Returns the duration to wait before trying the next attempt.
context represents the context of a retry operation. Read moreSource§fn with_max_attempts(self, max_attempts: u32) -> MaxAttemptsRetryPolicy<Self>
fn with_max_attempts(self, max_attempts: u32) -> MaxAttemptsRetryPolicy<Self>
Returns a new
RetryPolicy that respects the given maximum attempts.Source§fn with_max_total_delay(
self,
max_total_delay: Duration,
) -> MaxTotalDelayRetryPolicy<Self>
fn with_max_total_delay( self, max_total_delay: Duration, ) -> MaxTotalDelayRetryPolicy<Self>
Returns a new
RetryPolicy that respects the given total delay.Source§fn with_max_jitter(self, max_jitter: Duration) -> JitteredRetryPolicy<Self>
fn with_max_jitter(self, max_jitter: Duration) -> JitteredRetryPolicy<Self>
Returns a new
RetryPolicy that adds jitter(random delay) to underlying policy.Source§fn skip_retry_on_error<F>(self, function: F) -> FilteredRetryPolicy<Self, F>
fn skip_retry_on_error<F>(self, function: F) -> FilteredRetryPolicy<Self, F>
Skips retrying on errors that evaluate to
true after applying function.Auto Trait Implementations§
impl<T> Freeze for MaxAttemptsRetryPolicy<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaxAttemptsRetryPolicy<T>where
T: RefUnwindSafe,
impl<T> Send for MaxAttemptsRetryPolicy<T>where
T: Send,
impl<T> Sync for MaxAttemptsRetryPolicy<T>where
T: Sync,
impl<T> Unpin for MaxAttemptsRetryPolicy<T>where
T: Unpin,
impl<T> UnwindSafe for MaxAttemptsRetryPolicy<T>where
T: UnwindSafe,
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