Strategy

Trait Strategy 

Source
pub trait Strategy: MaybeSend + MaybeSync {
    // Required method
    fn backoff(&self, attempts: usize, time_spent: Instant) -> Option<Duration>;
}
Expand description

The strategy interface

Required Methods§

Source

fn backoff(&self, attempts: usize, time_spent: Instant) -> Option<Duration>

A time that this retry should backoff Returns None when we should no longer backoff, despite possibly being below attempts

Implementations on Foreign Types§

Source§

impl Strategy for ()

Source§

fn backoff(&self, _attempts: usize, _time_spent: Instant) -> Option<Duration>

Source§

impl<S: ?Sized + Strategy> Strategy for Box<S>

Source§

fn backoff(&self, attempts: usize, time_spent: Instant) -> Option<Duration>

Implementors§