saluki_io/net/util/retry/classifier/
mod.rs

1mod http;
2pub use self::http::StandardHttpClassifier;
3
4/// Determines whether or not a request should be retried.
5///
6/// This trait is closely related to [`tower::retry::Policy`], but allows us to decouple the logic of how to classify
7/// whether or not a request should be retried from the logic of determining how long to wait before retrying.
8pub trait RetryClassifier<Res, Error> {
9    /// Returns `true` if the original request should be retried.
10    fn should_retry(&self, response: &Result<Res, Error>) -> bool;
11}