Trait adaptive_backoff::adaptive::Adaptable[][src]

pub trait Adaptable {
    fn success(&mut self) -> Duration;
fn fail(&mut self) -> Duration; }

The Adaptive trait defines sucess and fail methods which are used to tune a backoff time.

Required methods

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

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

Loading content...

Implementors

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

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

success resets the backoff, increases success factor by the success multiplier and reduces the new returned delay.

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

fail uses the backoff and adds it, divided by the fail factor, to the running delay. It then returns the running delay.

Loading content...