Skip to main content

Policy

Trait Policy 

Source
pub trait Policy<Request> {
    // Required methods
    fn clone_request(&self, req: &Request) -> Option<Request>;
    fn can_retry(&self, req: &Request) -> bool;
}
Available on crate feature hedge only.
Expand description

A policy which describes which requests can be cloned and then whether those requests should be retried.

Required Methods§

Source

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

Called when the request is first received to determine if the request is retryable.

Source

fn can_retry(&self, req: &Request) -> bool

Called after the hedge timeout to determine if the hedge retry should be issued.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§