[−][src]Trait tryhard::OnRetry
Trait allowing you to run some future when a retry occurs. Could for example to be used for logging or other kinds of telemetry.
You wont have to implement this trait manually. It is implemented for functions with the right
signature. See RetryFuture::on_retry
for more details.
Associated Types
type Future: 'static + Future<Output = Self::Output> + Send
[src]
The type of the future you want to run.
type Output: 'static + Send
[src]
The output type of your future.
Required methods
pub fn on_retry(
&mut self,
attempt: u32,
next_delay: Option<Duration>,
previous_error: &E
) -> Self::Future
[src]
&mut self,
attempt: u32,
next_delay: Option<Duration>,
previous_error: &E
) -> Self::Future
Create another future to run.
If next_delay
is None
then your future is out of retries and wont be called again.
Implementors
impl<E> OnRetry<E> for NoOnRetry
[src]
type Future = Ready<Infallible>
type Output = Infallible
pub fn on_retry(&mut self, _: u32, _: Option<Duration>, _: &E) -> Self::Future
[src]
impl<F, E, FutureT> OnRetry<E> for F where
F: FnMut(u32, Option<Duration>, &E) -> FutureT,
FutureT: Future + Send + 'static,
FutureT::Output: Send + 'static,
[src]
F: FnMut(u32, Option<Duration>, &E) -> FutureT,
FutureT: Future + Send + 'static,
FutureT::Output: Send + 'static,