Skip to main content

RetryPolicy

Trait RetryPolicy 

Source
pub trait RetryPolicy: Send + Sync {
    // Required method
    fn decide(
        &self,
        response: &ResponseMeta<'_>,
        attempt: &AttemptInfo,
        schedule: &RetryConfig,
    ) -> Decision;
}
Expand description

Decides from a response what the loop does next.

Required Methods§

Source

fn decide( &self, response: &ResponseMeta<'_>, attempt: &AttemptInfo, schedule: &RetryConfig, ) -> Decision

Decide what follows response. schedule is the loop’s own RetryConfig, for a policy that sizes a hold from it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<DYNOSAUR> RetryPolicy for &DYNOSAUR
where DYNOSAUR: ?Sized + RetryPolicy, Self: Send + Sync,

Source§

fn decide( &self, response: &ResponseMeta<'_>, attempt: &AttemptInfo, schedule: &RetryConfig, ) -> Decision

Source§

impl<DYNOSAUR> RetryPolicy for &mut DYNOSAUR
where DYNOSAUR: ?Sized + RetryPolicy, Self: Send + Sync,

Source§

fn decide( &self, response: &ResponseMeta<'_>, attempt: &AttemptInfo, schedule: &RetryConfig, ) -> Decision

Source§

impl<DYNOSAUR> RetryPolicy for Box<DYNOSAUR>
where DYNOSAUR: ?Sized + RetryPolicy, Self: Send + Sync,

Source§

fn decide( &self, response: &ResponseMeta<'_>, attempt: &AttemptInfo, schedule: &RetryConfig, ) -> Decision

Implementors§

Source§

impl RetryPolicy for DefaultRetryPolicy

Source§

impl<'dynosaur_struct> RetryPolicy for DynRetryPolicy<'dynosaur_struct>