Trait tower::retry::backoff::Backoff

source ·
pub trait Backoff {
    type Future: Future<Output = ()>;

    // Required method
    fn next_backoff(&mut self) -> Self::Future;
}
Expand description

A backoff trait where a single mutable reference represents a single backoff session. Implementors must also implement Clone which will reset the backoff back to the default state for the next session.

Required Associated Types§

source

type Future: Future<Output = ()>

The future associated with each backoff. This usually will be some sort of timer.

Required Methods§

source

fn next_backoff(&mut self) -> Self::Future

Initiate the next backoff in the sequence.

Implementors§

source§

impl<R> Backoff for ExponentialBackoff<R>
where R: Rng,