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§
source§impl ServerErrorsAsFailures
impl ServerErrorsAsFailures
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ServerErrorsAsFailures
.
sourcepub fn make_classifier() -> SharedClassifier<Self>
pub fn make_classifier() -> SharedClassifier<Self>
Returns a MakeClassifier
that produces ServerErrorsAsFailures
.
This is a convenience function that simply calls SharedClassifier::new
.
Trait Implementations§
source§impl ClassifyResponse for ServerErrorsAsFailures
impl ClassifyResponse for ServerErrorsAsFailures
§type FailureClass = ServerErrorsFailureClass
type FailureClass = ServerErrorsFailureClass
The type returned when a response is classified as a failure. Read more
§type ClassifyEos = NeverClassifyEos<ServerErrorsFailureClass>
type ClassifyEos = NeverClassifyEos<ServerErrorsFailureClass>
The type used to classify the response end of stream (EOS).
source§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
source§fn classify_error<E>(self, error: &E) -> Self::FailureClasswhere
E: Display + 'static,
fn classify_error<E>(self, error: &E) -> Self::FailureClasswhere
E: Display + 'static,
Classify an error. Read more
source§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
source§impl Clone for ServerErrorsAsFailures
impl Clone for ServerErrorsAsFailures
source§fn clone(&self) -> ServerErrorsAsFailures
fn clone(&self) -> ServerErrorsAsFailures
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ServerErrorsAsFailures
impl Debug for ServerErrorsAsFailures
source§impl Default for ServerErrorsAsFailures
impl Default for ServerErrorsAsFailures
source§fn default() -> ServerErrorsAsFailures
fn default() -> ServerErrorsAsFailures
Returns the “default value” for a type. Read more