rama_http::layer::retry::managed

Trait RetryRule

Source
pub trait RetryRule<S, R, E>:
    Sealed<(S, R, E)>
    + Send
    + Sync
    + 'static {
    // Required method
    fn retry(
        &self,
        ctx: Context<S>,
        result: Result<R, E>,
    ) -> impl Future<Output = (Context<S>, Result<R, E>, bool)> + Send + '_;
}
Expand description

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

Required Methods§

Source

fn retry( &self, ctx: Context<S>, result: Result<R, E>, ) -> impl Future<Output = (Context<S>, 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", so this trait is not object safe.

Implementors§

Source§

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

Source§

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