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§
Sourcefn decide(
&self,
response: &ResponseMeta<'_>,
attempt: &AttemptInfo,
schedule: &RetryConfig,
) -> Decision
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".