pub struct Error { /* private fields */ }
Expand description
A custom trait object which holds all kinds of errors occurring in handlers.
Implementations
sourceimpl Error
impl Error
pub fn new<E: HttpError>(err: E) -> Self
sourcepub fn is<T: HttpError>(&self) -> bool
pub fn is<T: HttpError>(&self) -> bool
Returns true
if the inner error value has the type of T
.
sourcepub fn downcast_ref<T: HttpError>(&self) -> Option<&T>
pub fn downcast_ref<T: HttpError>(&self) -> Option<&T>
Attempts to downcast this error value to the specified concrete type by reference.
sourcepub fn downcast_mut<T: HttpError>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: HttpError>(&mut self) -> Option<&mut T>
Attempts to downcast this error value to the specified concrete type by reference.
sourcepub fn downcast<T: HttpError>(self) -> Result<T, Self>
pub fn downcast<T: HttpError>(self) -> Result<T, Self>
Attempts to downcast this error value into the specified concrete type.
sourcepub fn into_response(self, request: &Request<()>) -> Response<ResponseBody>
pub fn into_response(self, request: &Request<()>) -> Response<ResponseBody>
Consumes itself and creates an HTTP response from its value.
Trait Implementations
sourceimpl From<ApplyError> for Error
impl From<ApplyError> for Error
sourcefn from(_err: ApplyError) -> Self
fn from(_err: ApplyError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more