Struct ServerErrorsAsFailures

pub struct ServerErrorsAsFailures { /* private fields */ }

The default classifier used for normal HTTP responses.

Responses with a 5xx status code are considered failures, all others are considered successes.

Implementations

impl ServerErrorsAsFailures

fn new() -> Self

Create a new ServerErrorsAsFailures.

fn make_classifier() -> SharedClassifier<Self>

Returns a MakeClassifier that produces ServerErrorsAsFailures.

This is a convenience function that simply calls SharedClassifier::new.

Trait Implementations

impl ClassifyResponse for ServerErrorsAsFailures

type FailureClass = ServerErrorsFailureClass;
type ClassifyEos = NeverClassifyEos<ServerErrorsFailureClass>;
fn classify_response<B>(self, res: &Response<B>) -> ClassifiedResponse<Self::FailureClass, Self::ClassifyEos>
fn classify_error<E>(self, error: &E) -> Self::FailureClass
where
    E: Display + 'static,

impl Clone for ServerErrorsAsFailures

fn clone(&self) -> ServerErrorsAsFailures

impl Debug for ServerErrorsAsFailures

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for ServerErrorsAsFailures

fn default() -> ServerErrorsAsFailures

Auto Trait Implementations

impl Freeze for ServerErrorsAsFailures

impl RefUnwindSafe for ServerErrorsAsFailures

impl Send for ServerErrorsAsFailures

impl Sync for ServerErrorsAsFailures

impl Unpin for ServerErrorsAsFailures

impl UnsafeUnpin for ServerErrorsAsFailures

impl UnwindSafe for ServerErrorsAsFailures

Blanket Implementations

impl<T> Any for ServerErrorsAsFailures where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ServerErrorsAsFailures where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ServerErrorsAsFailures where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for ServerErrorsAsFailures where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for ServerErrorsAsFailures

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for ServerErrorsAsFailures

impl<T> PolicyExt for ServerErrorsAsFailures where T: ?Sized,

fn and<P, B, E>(self, other: P) -> And<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,
fn or<P, B, E>(self, other: P) -> Or<T, P>
where
    T: Sized + Policy<B, E>,
    P: Policy<B, E>,

impl<T> ToOwned for ServerErrorsAsFailures where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for ServerErrorsAsFailures

impl<T, U> Into<U> for ServerErrorsAsFailures where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ServerErrorsAsFailures where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for ServerErrorsAsFailures where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>