Trait kernel::retry::ShouldRetry

source ·
pub trait ShouldRetry<E> {
    // Required methods
    fn should_retry(&mut self, error: &E) -> bool;
    fn reset(&mut self);
}
Expand description

A strategy for determining whether an error is retryable.

Required Methods§

source

fn should_retry(&mut self, error: &E) -> bool

Returns true if the provided error is retryable.

source

fn reset(&mut self)

Implementors§

source§

impl<E> ShouldRetry<E> for AlwaysRetry

source§

impl<F, E> ShouldRetry<E> for F
where F: Fn(&E) -> bool,

source§

impl<P, E> ShouldRetry<E> for WithMaxRetries<P>
where P: ShouldRetry<E>,