Trait finchers_core::error::HttpError
[−]
[src]
pub trait HttpError: Debug + Display + Send + Sync + 'static { fn status_code(&self) -> StatusCode; fn append_headers(&self, headers: &mut HeaderMap<HeaderValue>) { ... } fn as_fail(&self) -> Option<&Fail> { ... } }
Trait representing error values from endpoints.
The types which implements this trait will be implicitly converted to an HTTP response by the runtime.
Required Methods
fn status_code(&self) -> StatusCode
Return the HTTP status code associated with this error type.
Provided Methods
fn append_headers(&self, headers: &mut HeaderMap<HeaderValue>)
Append a set of header values to the header map.
fn as_fail(&self) -> Option<&Fail>
Return the reference to a value of Fail
if exists.
Implementations on Foreign Types
impl<L, R> HttpError for Either<L, R> where
L: HttpError,
R: HttpError,
[src]
L: HttpError,
R: HttpError,
fn status_code(&self) -> StatusCode
[src]
fn as_fail(&self) -> Option<&Fail>
[src]
fn append_headers(&self, headers: &mut HeaderMap<HeaderValue>)
[src]
Implementors
impl HttpError for Never
impl HttpError for BadRequest
impl HttpError for ServerError
impl HttpError for NotPresent
impl HttpError for PollDataError
impl HttpError for InvalidMediaType