Struct tsukuyomi::Error [−][src]
pub struct Error { /* fields omitted */ }
A type which holds all kinds of errors occurring in handlers.
Methods
impl Error
[src]
impl Error
pub fn from_failure<E>(cause: E, status: StatusCode) -> Error where
E: Into<Error>,
[src]
pub fn from_failure<E>(cause: E, status: StatusCode) -> Error where
E: Into<Error>,
Creates an HTTP error from an error value and an HTTP status code.
pub fn not_found() -> Error
[src]
pub fn not_found() -> Error
Creates an HTTP error representing "404 Not Found".
pub fn method_not_allowed() -> Error
[src]
pub fn method_not_allowed() -> Error
Creates an HTTP error representing "405 Method Not Allowed".
pub fn bad_request<E>(e: E) -> Error where
E: Into<Error>,
[src]
pub fn bad_request<E>(e: E) -> Error where
E: Into<Error>,
Creates an HTTP error representing "400 Bad Request" from the provided error value.
pub fn internal_server_error<E>(e: E) -> Error where
E: Into<Error>,
[src]
pub fn internal_server_error<E>(e: E) -> Error where
E: Into<Error>,
Creates an HTTP error representing "500 Internal Server Error", from the provided error value .
pub fn critical<E>(err: E) -> Error where
E: Into<CritError>,
[src]
pub fn critical<E>(err: E) -> Error where
E: Into<CritError>,
Creates a critical error from an error value.
The word "critical" means that the error will not be converted into an HTTP response. If the framework receives this kind of error, it wlll abort the current connection abruptly without sending an HTTP response.
See the documentation at hyper for details.
pub fn is_critical(&self) -> bool
[src]
pub fn is_critical(&self) -> bool
Returns true
if this error is a critical error.
pub fn as_http_error(&self) -> Option<&HttpError>
[src]
pub fn as_http_error(&self) -> Option<&HttpError>
Returns the representation as HttpError
of this error value.
If the value is a criticial error, it will return a None
.
Trait Implementations
impl Debug for Error
[src]
impl Debug for Error
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<E> From<E> for Error where
E: HttpError,
[src]
impl<E> From<E> for Error where
E: HttpError,