Struct tower_http::classify::ServerErrorsAsFailures
source · [−]pub struct ServerErrorsAsFailures { /* private fields */ }
Expand description
The default classifier used for normal HTTP responses.
Responses with a 5xx
status code are considered failures, all others are considered
successes.
Implementations
Create a new ServerErrorsAsFailures
.
Returns a MakeClassifier
that produces ServerErrorsAsFailures
.
This is a convenience function that simply calls SharedClassifier::new
.
Trait Implementations
The type returned when a response is classified as a failure. Read more
The type used to classify the response end of stream (EOS).
fn classify_response<B>(
self,
res: &Response<B>
) -> ClassifiedResponse<Self::FailureClass, Self::ClassifyEos>
fn classify_response<B>(
self,
res: &Response<B>
) -> ClassifiedResponse<Self::FailureClass, Self::ClassifyEos>
Attempt to classify the beginning of a response. Read more
Classify an error. Read more
fn map_failure_class<F, NewClass>(self, f: F) -> MapFailureClass<Self, F> where
Self: Sized,
F: FnOnce(Self::FailureClass) -> NewClass,
fn map_failure_class<F, NewClass>(self, f: F) -> MapFailureClass<Self, F> where
Self: Sized,
F: FnOnce(Self::FailureClass) -> NewClass,
Transform the failure classification using a function. Read more
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ServerErrorsAsFailures
impl Send for ServerErrorsAsFailures
impl Sync for ServerErrorsAsFailures
impl Unpin for ServerErrorsAsFailures
impl UnwindSafe for ServerErrorsAsFailures
Blanket Implementations
Mutably borrows from an owned value. Read more
follow-redirect
only.Create a new Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more