pub trait HttpError:
Debug
+ Display
+ Send
+ Sync
+ 'static {
// Required method
fn status_code(&self) -> StatusCode;
// Provided methods
fn append_headers(&self, headers: &mut HeaderMap<HeaderValue>) { ... }
fn as_fail(&self) -> Option<&dyn Fail> { ... }
}
Expand description
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§
Sourcefn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Return the HTTP status code associated with this error type.
Provided Methods§
Sourcefn append_headers(&self, headers: &mut HeaderMap<HeaderValue>)
fn append_headers(&self, headers: &mut HeaderMap<HeaderValue>)
Append a set of header values to the header map.