Trait backoff::backoff::Backoff

source ·
pub trait Backoff {
    // Required method
    fn next_backoff(&mut self) -> Option<Duration>;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

Backoff is a backoff policy for retrying an operation.

Required Methods§

source

fn next_backoff(&mut self) -> Option<Duration>

next_backoff() time is elapsed before it is called again. If it returns None, it means the operation timed out and no further retries are done.

Provided Methods§

source

fn reset(&mut self)

Resets the internal state to the initial value.

Implementations on Foreign Types§

source§

impl<B: Backoff + ?Sized> Backoff for Box<B>

source§

fn next_backoff(&mut self) -> Option<Duration>

source§

fn reset(&mut self)

Implementors§