[][src]Trait futures_retrying::Backoff

pub trait Backoff: Send {
    fn next_retry(&mut self) -> Option<Duration>;

    fn exponential(self) -> Exponential<Self>
    where
        Self: Sized
, { ... }
fn max_backoff(self, max: Duration) -> Max<Self>
    where
        Self: Sized
, { ... }
fn min_backoff(self, min: Duration) -> Min<Self>
    where
        Self: Sized
, { ... }
fn jitter(self, scale: f64) -> Jitter<Self>
    where
        Self: Sized
, { ... }
fn num_attempts(self, num: u32) -> MaxAttempts<Self>
    where
        Self: Sized
, { ... }
fn deadline(self, deadline: Instant) -> Deadline<Self>
    where
        Self: Sized
, { ... } }

Required methods

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

Get the duration to wait for before attempting again

Loading content...

Provided methods

fn exponential(self) -> Exponential<Self> where
    Self: Sized

Grow the backoff duration exponentially

fn max_backoff(self, max: Duration) -> Max<Self> where
    Self: Sized

Set the maximum backoff duration

fn min_backoff(self, min: Duration) -> Min<Self> where
    Self: Sized

Set the minimum backoff duration

fn jitter(self, scale: f64) -> Jitter<Self> where
    Self: Sized

Randomize the backoff duration.

The returned duration will never be larger than the base duration and will never be smaller than base * (1.0 - scale).

fn num_attempts(self, num: u32) -> MaxAttempts<Self> where
    Self: Sized

fn deadline(self, deadline: Instant) -> Deadline<Self> where
    Self: Sized

Loading content...

Implementations on Foreign Types

impl Backoff for Duration[src]

Loading content...

Implementors

impl<S> Backoff for Deadline<S> where
    S: Backoff
[src]

impl<S> Backoff for Exponential<S> where
    S: Backoff
[src]

impl<S> Backoff for Jitter<S> where
    S: Backoff
[src]

impl<S> Backoff for Max<S> where
    S: Backoff
[src]

impl<S> Backoff for MaxAttempts<S> where
    S: Backoff
[src]

impl<S> Backoff for Min<S> where
    S: Backoff
[src]

Loading content...