Trait tokio_retry::middleware::StrategyFactory
source · [−]pub trait StrategyFactory {
type Iter: Iterator<Item = Duration>;
fn get_strategy(&self) -> Self::Iter;
}
Expand description
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);