[][src]Trait adaptive_backoff::backoff::Backoff

pub trait Backoff {
    pub fn wait(&mut self) -> Duration;
pub fn reset(&mut self); }

The Backoff trait provides a method to return how long to back off when called.

Required methods

pub fn wait(&mut self) -> Duration[src]

wait for the next backoff duration. Each backoff function will vary in how the duration changes with time.

pub fn reset(&mut self)[src]

reset the backoff duration to the initial if it has some running state.

Loading content...

Implementors

impl Backoff for ExponentialBackoff[src]

impl<B: Backoff> Backoff for Adaptive<B>[src]

pub fn wait(&mut self) -> Duration[src]

wait returns the current running delay. If success or fail are never called, it returns zero.

pub fn reset(&mut self)[src]

reset returns to the base delay and clears the internal fail and success factor.

Loading content...