Skip to main content

HttpError

Trait HttpError 

Source
pub trait HttpError:
    Error
    + Send
    + Sync
    + 'static {
    // Provided methods
    fn status(&self) -> StatusCode { ... }
    fn reason(&self) -> String { ... }
    fn type_name(&self) -> &str { ... }
}
Expand description

Trait implemented by errors that can be converted into HttpErrors and used as error responses

Provided Methods§

Source

fn status(&self) -> StatusCode

Provides the HTTP StatusCode to use when creating this error response

Source

fn reason(&self) -> String

Provides the reason message to use in the error response

Source

fn type_name(&self) -> &str

Provides the full type name for the actual error type thats been erased by dynamic typing (For better error source clarity)

Implementations on Foreign Types§

Source§

impl HttpError for Error

Source§

impl HttpError for InvalidHeaderValue

Implementors§