Policy

Trait Policy 

Source
pub trait Policy<Req, S: Service<Req>>: Sized + Clone {
    // Required methods
    async fn retry(
        &mut self,
        req: &Req,
        res: &Result<S::Response, S::Error>,
    ) -> bool;
    fn clone_request(&self, req: &Req) -> Option<Req>;
}
Expand description

Trait defines retry policy

Required Methods§

Source

async fn retry( &mut self, req: &Req, res: &Result<S::Response, S::Error>, ) -> bool

Source

fn clone_request(&self, req: &Req) -> Option<Req>

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<R, S> Policy<R, S> for DefaultRetryPolicy
where R: Clone, S: Service<R>,