Skip to main content

RetryRule

Trait RetryRule 

pub trait RetryRule<Request, R, E>:
    Sealed<(Request, R, E)>
    + Send
    + Sync
    + 'static {
    // Required method
    fn retry(
        &self,
        request: Request,
        result: Result<R, E>,
    ) -> impl Future<Output = (Request, Result<R, E>, bool)> + Send;
}
Available on crate feature http only.
Expand description

A trait that is used to umbrella-cover all possible implementation kinds for the retry rule functionality.

Required Methods§

fn retry( &self, request: Request, result: Result<R, E>, ) -> impl Future<Output = (Request, Result<R, E>, bool)> + Send

Check if the given result should be retried.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl<F, Fut, Request, R, E> RetryRule<Request, R, E> for F
where F: Fn(Request, Result<R, E>) -> Fut + Send + Sync + 'static, Fut: Future<Output = (Request, Result<R, E>, bool)> + Send + 'static, Request: Send + 'static, R: Send + 'static, E: Send + Sync + 'static,

§

impl<Request, Body, E> RetryRule<Request, Response<Body>, E> for Undefined
where E: Debug + Send + Sync + 'static, Body: Send + 'static, Request: ExtensionsRef + Send + 'static,