Trait tokio_retry::RetryStrategy [] [src]

pub trait RetryStrategy {
    fn delay(&mut self) -> Option<Duration>;

    fn jitter(self) -> Jittered<Self> where Self: Sized { ... }
    fn limit_retries(self, max_retries: usize) -> LimitedRetries<Self> where Self: Sized { ... }
    fn limit_delay(self, max_delay: Duration) -> LimitedDelay<Self> where Self: Sized { ... }
    fn run<S, A, F>(self, sleep: S, action: F) -> RetryFuture<S, Self, A, F> where S: Sleep, Self: Sized, A: IntoFuture, F: FnMut() -> A { ... }
}

Trait that specifies a retry behaviour.

Required Methods

If Some is returned, causes a delay of the specified duration before the next attempt. If None is returned, causes no further attempts.

Provided Methods

Introduce full random jitter to the delay between attempts.

Limit the number of retries.

Limit the delay between attempts.

Run the provided action, and if it fails, retry it using this strategy.

Implementors