pub struct FilteredRetryPolicy<T: RetryPolicy, F> { /* private fields */ }Expand description
Decorates the given RetryPolicy by not retrying on errors that match the given function.
Trait Implementations§
Source§impl<T, F, E> RetryPolicy for FilteredRetryPolicy<T, F>
impl<T, F, E> RetryPolicy for FilteredRetryPolicy<T, F>
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<'_, E>) -> Option<Duration>
fn next_delay(&self, context: &RetryContext<'_, 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, F> Freeze for FilteredRetryPolicy<T, F>
impl<T, F> RefUnwindSafe for FilteredRetryPolicy<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for FilteredRetryPolicy<T, F>
impl<T, F> Sync for FilteredRetryPolicy<T, F>
impl<T, F> Unpin for FilteredRetryPolicy<T, F>
impl<T, F> UnwindSafe for FilteredRetryPolicy<T, F>where
T: UnwindSafe,
F: 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