pub enum Error {
Responder(Response<Body>),
Normal(Box<dyn Error + Send + Sync + 'static, Global>),
Report(Box<dyn Error + Send + Sync + 'static, Global>, Response<Body>),
}
Expand description
Represents errors that can occur handling application.
Variants§
Responder(Response<Body>)
Receives a Response
as error.
Normal(Box<dyn Error + Send + Sync + 'static, Global>)
Receives a boxed std::error::Error
as error.
Report(Box<dyn Error + Send + Sync + 'static, Global>, Response<Body>)
Receives a boxed std::error::Error
and Response
pair as error.
Implementations§
source§impl Error
impl Error
sourcepub fn normal<T>(t: T) -> Errorwhere
T: 'static + Error + Send + Sync,
pub fn normal<T>(t: T) -> Errorwhere
T: 'static + Error + Send + Sync,
Create a new error object from any error type.
sourcepub fn is<T>(&self) -> boolwhere
T: 'static + Error,
pub fn is<T>(&self) -> boolwhere
T: 'static + Error,
Forwards to the method defined on the type dyn Error
.
sourcepub fn downcast<T>(self) -> Result<T, Error>where
T: 'static + Error,
pub fn downcast<T>(self) -> Result<T, Error>where
T: 'static + Error,
Attempt to downcast the error object to a concrete type.
sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: 'static + Error,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: 'static + Error,
Downcast this error object by reference.
sourcepub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: 'static + Error,
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: 'static + Error,
Downcast this error object by mutable reference.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<CookiesError> for Error
impl From<CookiesError> for Error
source§fn from(e: CookiesError) -> Error
fn from(e: CookiesError) -> Error
Converts to this type from the input type.
source§impl From<ParamsError> for Error
impl From<ParamsError> for Error
source§fn from(e: ParamsError) -> Error
fn from(e: ParamsError) -> Error
Converts to this type from the input type.
source§impl From<PayloadError> for Error
impl From<PayloadError> for Error
source§fn from(e: PayloadError) -> Error
fn from(e: PayloadError) -> Error
Converts to this type from the input type.
source§impl From<WebSocketError> for Error
impl From<WebSocketError> for Error
source§fn from(e: WebSocketError) -> Error
fn from(e: WebSocketError) -> Error
Converts to this type from the input type.