[][src]Trait adventure::RetriableRequest

pub trait RetriableRequest: BaseRequest {
    fn should_retry(&self, error: &Self::Error, next_interval: Duration) -> bool;

    fn retry(self) -> RetryingTokio<Self>
    where
        Self: Sized
, { ... }
fn retry_with_backoff<B>(self, backoff: B) -> RetryingTokio<Self, B>
    where
        Self: BaseRequest + Sized,
        B: Backoff
, { ... } }

A request able to decide to send itself again if the previous attempt has failed.

Required methods

fn should_retry(&self, error: &Self::Error, next_interval: Duration) -> bool

Loading content...

Provided methods

fn retry(self) -> RetryingTokio<Self> where
    Self: Sized

Wrap this request to retry itself on failure, with a default ExponentialBackoff strategy.

It should be called within the tokio execution context, because the default timer is implemented using tokio_timer.

fn retry_with_backoff<B>(self, backoff: B) -> RetryingTokio<Self, B> where
    Self: BaseRequest + Sized,
    B: Backoff

Wrap this request to retry itself on failure, with a given backoff strategy.

It should be called within the tokio execution context, because the default timer is implemented using tokio_timer.

Loading content...

Implementations on Foreign Types

impl<'_, R> RetriableRequest for &'_ R where
    R: RetriableRequest
[src]

impl<P> RetriableRequest for Pin<P> where
    P: Deref,
    <P as Deref>::Target: RetriableRequest
[src]

impl<R> RetriableRequest for Box<R> where
    R: RetriableRequest
[src]

Loading content...

Implementors

impl<R> RetriableRequest for Oneshot<R> where
    R: RetriableRequest
[src]

impl<R> RetriableRequest for Repeat<R> where
    R: RetriableRequest
[src]

Loading content...