pub trait RetryClassifier<Res, Error> {
// Required method
fn should_retry(&self, response: &Result<Res, Error>) -> bool;
}
Expand description
Determines whether or not a request should be retried.
This trait is closely related to tower::retry::Policy
, but allows us to decouple the logic of how to classify
whether or not a request should be retried from the logic of determining how long to wait before retrying.
Required Methods§
Sourcefn should_retry(&self, response: &Result<Res, Error>) -> bool
fn should_retry(&self, response: &Result<Res, Error>) -> bool
Returns true
if the original request should be retried.