tokio_retry/
condition.rs

1/// Specifies under which conditions a retry is attempted.
2pub trait Condition<E> {
3    fn should_retry(&mut self, error: &E) -> bool;
4}
5
6impl<E, F: FnMut(&E) -> bool> Condition<E> for F {
7    fn should_retry(&mut self, error: &E) -> bool {
8        self(error)
9    }
10}