pub struct Error { /* private fields */ }
Expand description
A custom trait object which holds all kinds of errors occurring in handlers.
Implementations§
Source§impl 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§
Source§impl From<ApplyError> for Error
impl From<ApplyError> for Error
Source§fn from(_err: ApplyError) -> Self
fn from(_err: ApplyError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more