pub trait Classifier<T, E> {
// Required method
fn is_server_error(&self, result: &Result<T, E>) -> bool;
}Expand description
Inspects the result of a service call to determine whether the outcome should be treated as a server error for concurrency-control purposes.
By default (DefaultClassifier), any Err variant is considered a server
error. Implement this trait to distinguish client errors, expected failures,
or successful-but-bad responses (e.g. HTTP 503) from true server errors.
Required Methods§
fn is_server_error(&self, result: &Result<T, E>) -> bool
Implementors§
impl<F, T, E> Classifier<T, E> for F
Blanket impl: any closure Fn(&Result<T, E>) -> bool works as a classifier.