Trait tokio_retry::middleware::StrategyFactory [] [src]

pub trait StrategyFactory {
    type Iter: Iterator<Item = Duration>;
    fn get_strategy(&self) -> Self::Iter;
}

Trait to produce iterators that will be used as retry strategies.

Can be implemented directly, but the simplest way to instantiate a strategy factory is by leveraging the impl for Fn():

let retry_strategy = || ExponentialBackoff::from_millis(10);

Associated Types

Required Methods

Implementors