#[non_exhaustive]pub enum DispatchError {
Service(Response<BoxBody>),
Body(Box<dyn Error>),
Upgrade,
Io(Error),
Parse(ParseError),
H2(Error),
SlowRequestTimeout,
DisconnectTimeout,
HandlerDroppedPayload,
InternalError,
}Expand description
A set of errors that can occur during dispatching HTTP requests.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Service(Response<BoxBody>)
Service error.
Body(Box<dyn Error>)
Body streaming error.
Upgrade
Upgrade service error.
Io(Error)
An io::Error that occurred while trying to read or write to a network stream.
Parse(ParseError)
Request parse error.
H2(Error)
Available on crate feature
http2 only.HTTP/2 error.
SlowRequestTimeout
The first request did not complete within the specified timeout.
DisconnectTimeout
Disconnect timeout. Makes sense for TLS streams.
HandlerDroppedPayload
Handler dropped payload before reading EOF.
InternalError
Internal error.
Trait Implementations§
Source§impl Debug for DispatchError
impl Debug for DispatchError
Source§impl Display for DispatchError
impl Display for DispatchError
Source§impl Error for DispatchError
impl Error for DispatchError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for DispatchError
impl From<Error> for DispatchError
Source§fn from(value: Error) -> DispatchError
fn from(value: Error) -> DispatchError
Converts to this type from the input type.
Source§impl From<Error> for DispatchError
impl From<Error> for DispatchError
Source§fn from(value: Error) -> DispatchError
fn from(value: Error) -> DispatchError
Converts to this type from the input type.
Source§impl From<ParseError> for DispatchError
impl From<ParseError> for DispatchError
Source§fn from(value: ParseError) -> DispatchError
fn from(value: ParseError) -> DispatchError
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for DispatchError
impl !RefUnwindSafe for DispatchError
impl !Send for DispatchError
impl !Sync for DispatchError
impl !UnwindSafe for DispatchError
impl Forget for DispatchError
impl Move for DispatchError
impl Unpin for DispatchErrorwhere
Box<ResponseHead>: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
Box<dyn MessageBody<Error = Box<dyn Error>>>: Unpin,
*const u8 is !null: Unpin,
*const (): Unpin,
Box<dyn Any>: Unpin,
Box<dyn Error>: Unpin,
*const () is !null: Unpin,
&'static SimpleMessage: Unpin,
*const Custom is !null: Unpin,
impl UnsafeUnpin for DispatchErrorwhere
*const ResponseHead is !null: UnsafeUnpin,
PhantomData<ResponseHead>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
*const dyn MessageBody<Error = Box<dyn Error>> is !null: UnsafeUnpin,
PhantomData<dyn MessageBody<Error = Box<dyn Error>>>: UnsafeUnpin,
PhantomData<fn() -> NoOpHasher>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(TypeId, Box<dyn Any>)>: UnsafeUnpin,
*const dyn Error is !null: UnsafeUnpin,
PhantomData<dyn Error>: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: 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