[][src]Trait backoff_futures::BackoffExt

pub trait BackoffExt<Fut, B, F> {
    fn with_backoff(self, backoff: &mut B) -> BackoffFuture<Fut, B, F>;
}

Required methods

Important traits for BackoffFuture<'_, Fut, B, F>
fn with_backoff(self, backoff: &mut B) -> BackoffFuture<Fut, B, F>

Returns a future that, when polled, will first ask self for a new future (with an output type Result<T, backoff::Error<_>> to produce the expected result.

If the underlying future is ready with an Err value, the nature of the error (permanent/transient) will determine whether polling the future will employ the provided backoff strategy and will result in the the work being retried.

Specifically, backoff::Error::Permanent errors will be returned immediately. backoff::Error::Transient errors will, depending on the particular backoff::backoff::Backoff, result in a retry attempt, most likely with a delay.

If the underlying future is ready with an Ok value, it will be returned immediately.

Loading content...

Implementors

impl<Fut, T, E, B, F> BackoffExt<Fut, B, F> for F where
    F: FnMut() -> Fut,
    Fut: Future<Output = Result<T, Error<E>>>, 
[src]

Loading content...