pub enum RouteError<E> {
AppSpecific(E),
Request(RequestError),
UnsupportedContentType,
Binary(Error),
Json(Error),
Tide {
status: StatusCode,
message: String,
},
ExportMetrics(String),
IncorrectMethod {
expected: String,
},
}Expand description
An error returned by a route handler.
RouteError encapsulates application specific errors E returned by the user-installed handler
itself. It also includes errors in the route dispatching logic, such as failures to turn the
result of the user-installed handler into an HTTP response.
Variants§
AppSpecific(E)
Request(RequestError)
UnsupportedContentType
Binary(Error)
Json(Error)
Tide
ExportMetrics(String)
IncorrectMethod
Implementations§
Source§impl<E> RouteError<E>
impl<E> RouteError<E>
pub fn status(&self) -> StatusCode
pub fn map_app_specific<E2>(self, f: impl Fn(E) -> E2) -> RouteError<E2>
Trait Implementations§
Source§impl<E: Debug> Debug for RouteError<E>
impl<E: Debug> Debug for RouteError<E>
Source§impl<E: Display> Display for RouteError<E>
impl<E: Display> Display for RouteError<E>
Source§impl<E> From<RequestError> for RouteError<E>
impl<E> From<RequestError> for RouteError<E>
Source§fn from(err: RequestError) -> Self
fn from(err: RequestError) -> Self
Converts to this type from the input type.
Source§impl<E: Display> From<RouteError<E>> for ServerError
impl<E: Display> From<RouteError<E>> for ServerError
Source§fn from(source: RouteError<E>) -> Self
fn from(source: RouteError<E>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for RouteError<E>
impl<E> !UnwindSafe for RouteError<E>
impl<E> Freeze for RouteError<E>where
E: Freeze,
impl<E> Send for RouteError<E>where
E: Send,
impl<E> Sync for RouteError<E>where
E: Sync,
impl<E> Unpin for RouteError<E>where
E: Unpin,
impl<E> UnsafeUnpin for RouteError<E>where
E: UnsafeUnpin,
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