rustmax::tower::retry::backoff

Trait 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§