Trait tower_http::classify::MakeClassifier [−][src]
pub trait MakeClassifier { type Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>; type FailureClass; type ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>; 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
.
Associated Types
type Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>
[src]
type Classifier: ClassifyResponse<FailureClass = Self::FailureClass, ClassifyEos = Self::ClassifyEos>
[src]The response classifier produced.
type FailureClass
[src]
type FailureClass
[src]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.
type ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>
[src]
type ClassifyEos: ClassifyEos<FailureClass = Self::FailureClass>
[src]The type used to classify the response end of stream (EOS).
Required methods
fn make_classifier<B>(&self, req: &Request<B>) -> Self::Classifier
[src]
fn make_classifier<B>(&self, req: &Request<B>) -> Self::Classifier
[src]Returns a response classifier for this request
Implementors
impl<C> MakeClassifier for SharedClassifier<C> where
C: ClassifyResponse + Clone,
[src]
impl<C> MakeClassifier for SharedClassifier<C> where
C: ClassifyResponse + Clone,
[src]