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
fn get_strategy(&self) -> Self::Iter
Implementors
impl<F, I: IntoIterator<Item = Duration>> StrategyFactory for F where
F: Fn() -> I,