pub trait NewRequestPolicywhere
    Self::Policy: Send + Sync,{
    type Policy;

    // Required method
    fn new_request_policy(
        &self,
        sleep_impl: Option<Arc<dyn AsyncSleep>>
    ) -> Self::Policy;
}
Expand description

A policy instantiator.

Implementors are essentially “policy factories” that can produce a new instance of a retry policy mechanism for each request, which allows both shared global state and per-request local state.

Required Associated Types§

source

type Policy

The type of the per-request policy mechanism.

Required Methods§

source

fn new_request_policy( &self, sleep_impl: Option<Arc<dyn AsyncSleep>> ) -> Self::Policy

Create a new policy mechanism instance.

Implementors§