pub struct ErrorKind { /* private fields */ }
Expand description
A list specifying the general categories of Tower Web errors.
Implementations§
Source§impl ErrorKind
impl ErrorKind
Sourcepub fn bad_request() -> ErrorKind
👎Deprecated: please use ‘Error::from(http::StatusCode::BAD_REQUEST)’ instead
pub fn bad_request() -> ErrorKind
Returns a new ErrorKind
value representing a 400 – bad request error.
Sourcepub fn is_bad_request(&self) -> bool
👎Deprecated: please use ‘kind() == http::StatusCode::BAD_REQUEST’ instead
pub fn is_bad_request(&self) -> bool
Returns true
if self
represents a 400 – bad request error
👎Deprecated: please use ‘Error::from(http::StatusCode::UNAUTHORIZED)’ instead
Returns a new ErrorKind
value representing a 401 – unauthorized error.
Sourcepub fn forbidden() -> ErrorKind
👎Deprecated: please use ‘Error::from(http::StatusCode::FORBIDDEN)’ instead
pub fn forbidden() -> ErrorKind
Returns a new ErrorKind
value representing a 403 – forbidden error.
Sourcepub fn not_found() -> ErrorKind
👎Deprecated: please use ‘Error::from(http::StatusCode::NOT_FOUND)’ instead
pub fn not_found() -> ErrorKind
Returns a new ErrorKind
value representing a 404 – not found error
Sourcepub fn is_not_found(&self) -> bool
👎Deprecated: please use ‘kind() == http::StatusCode::NOT_FOUND’ instead
pub fn is_not_found(&self) -> bool
Returns true
if self
represents a 404 – not found error
Sourcepub fn unprocessable_entity() -> ErrorKind
👎Deprecated: please use ‘Error::from(http::StatusCode::UNPROCESSABLE_ENTITY)’ instead
pub fn unprocessable_entity() -> ErrorKind
Returns a new ErrorKind
value representing a 422 – unprocessable entity error
Sourcepub fn internal() -> ErrorKind
👎Deprecated: please use ‘Error::from(http::StatusCode::INTERNAL_SERVER_ERROR)’ instead
pub fn internal() -> ErrorKind
Returns a new ErrorKind
value representing 500 – internal server
error.
Sourcepub fn is_internal(&self) -> bool
👎Deprecated: please use ‘kind() == http::StatusCode::INTERNAL_SERVER_ERROR’ instead
pub fn is_internal(&self) -> bool
Returns true
if self
represents a 500 – internal server error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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