[][src]Trait tryhard::backoff_strategies::BackoffStrategy

pub trait BackoffStrategy<E> {
    type Output;
    pub fn delay(&mut self, attempt: u32, error: &E) -> Self::Output;
}

Trait for computing the amount of delay between attempts.

Associated Types

type Output[src]

The delay type. Will normally be either Duration or RetryPolicy.

Loading content...

Required methods

pub fn delay(&mut self, attempt: u32, error: &E) -> Self::Output[src]

Compute the amount of delay given the number of attempts so far and the most previous error.

Loading content...

Implementors

impl<E> BackoffStrategy<E> for ExponentialBackoff[src]

type Output = Duration

impl<E> BackoffStrategy<E> for FixedBackoff[src]

type Output = Duration

impl<E> BackoffStrategy<E> for LinearBackoff[src]

type Output = Duration

impl<E> BackoffStrategy<E> for NoBackoff[src]

type Output = Duration

impl<F, E, T> BackoffStrategy<E> for CustomBackoffStrategy<F> where
    F: FnMut(u32, &E) -> T,
    T: Into<RetryPolicy>, 
[src]

type Output = RetryPolicy

Loading content...