pub trait MakeClassifier {
type Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>;
type FailureClass;
type ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>;
// Required method
fn make_classifier<B>(&self, req: &Request<B>) -> Self::Classifier;
}
Expand description
Trait for producing response classifiers from a request.
This is useful when a classifier depends on data from the request. For example, this could include the URI or HTTP method.
This trait is generic over the Error
type of the Service
s used with the classifier.
This is necessary for ClassifyResponse::classify_error
.
Required Associated Types§
Sourcetype Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>
type Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>
The response classifier produced.
Sourcetype FailureClass
type FailureClass
The type of failure classifications.
This might include additional information about the error, such as whether it was a client or server error, or whether or not it should be considered retryable.
Sourcetype ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>
type ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>
The type used to classify the response end of stream (EOS).
Required Methods§
Sourcefn make_classifier<B>(&self, req: &Request<B>) -> Self::Classifier
fn make_classifier<B>(&self, req: &Request<B>) -> Self::Classifier
Returns a response classifier for this request
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.