Struct tokio_retry::strategies::FromIterator [] [src]

pub struct FromIterator<T> where T: IntoIterator<Item=Duration> { /* fields omitted */ }

A retry strategy backed by an iterator.

Example:

use std::time::Duration;
use tokio_retry::strategies::FromIterator;

let delays = vec![
  Duration::from_millis(10),
  Duration::from_millis(20),
  Duration::from_millis(30)
];

let retry = FromIterator::new(delays);

Methods

impl<T> FromIterator<T> where T: IntoIterator<Item=Duration>
[src]

Trait Implementations

impl<T: Clone> Clone for FromIterator<T> where T: IntoIterator<Item=Duration>,
        T::IntoIter: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> RetryStrategy for FromIterator<T> where T: IntoIterator<Item=Duration>
[src]

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

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.