Skip to main content

HttpError

Trait HttpError 

Source
pub trait HttpError: Error {
    // Required method
    fn status_code(&self) -> StatusCode;

    // Provided methods
    fn reason(&self, f: &mut Formatter<'_>) -> Result { ... }
    fn headers(&self) -> Option<Vec<(HeaderName, HeaderValue)>> { ... }
}

Required Methods§

Provided Methods§

Source

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

Source

fn headers(&self) -> Option<Vec<(HeaderName, HeaderValue)>>

Trait Implementations§

Source§

impl From<AnyHttpError> for Box<dyn HttpError + Send + 'static>

Source§

fn from(err: AnyHttpError) -> Self

Converts to this type from the input type.
Source§

impl<E> From<E> for Box<dyn HttpError>
where E: HttpError + 'static,

Source§

fn from(err: E) -> Self

Converts to this type from the input type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<E> HttpError for Box<E>
where E: HttpError,

Implementors§

Source§

impl HttpError for http_error::option_ext::StatusError

Source§

impl<E> HttpError for http_error::result_ext::StatusError<E>
where E: Error + 'static,