pub trait ErrorResponse:
StdError
+ IntoResponse
+ 'static {
// Provided method
fn into_error_result(self) -> Result<Response, BoxedErrorResponse>
where Self: Sized + Send + Sync { ... }
}Expand description
Blanketly implemented by error types that can be converted into the Response type.
Provided Methods§
Sourcefn into_error_result(self) -> Result<Response, BoxedErrorResponse>
fn into_error_result(self) -> Result<Response, BoxedErrorResponse>
Converts the ErrorResponse into ResponseResult::Err(BoxedErrorResponse).
Implementations§
Source§impl dyn ErrorResponse + Send + Sync
impl dyn ErrorResponse + Send + Sync
Sourcepub fn implementor_type_id(&self) -> TypeId
pub fn implementor_type_id(&self) -> TypeId
Returns the TypeId of the implementor.
Sourcepub fn is<E: Any + 'static>(&self) -> bool
pub fn is<E: Any + 'static>(&self) -> bool
Checks whether the implementor of the trait is the given type E.
Sourcepub fn downcast_to<E: Any + 'static>(
self: Box<Self>,
) -> Result<Box<E>, Box<Self>>
pub fn downcast_to<E: Any + 'static>( self: Box<Self>, ) -> Result<Box<E>, Box<Self>>
Casts the trait object into type E if it’s an underlying concrete type.
Sourcepub fn downcast_to_ref<E: Any + 'static>(&self) -> Option<&E>
pub fn downcast_to_ref<E: Any + 'static>(&self) -> Option<&E>
Returns a reference to an underlying concrete type if it’s a type E.
Sourcepub fn downcast_to_mut<E: Any + 'static>(&mut self) -> Option<&mut E>
pub fn downcast_to_mut<E: Any + 'static>(&mut self) -> Option<&mut E>
Returns a mutable reference to an underlying concrete type if it’s a type E.
Sourcepub fn into_response(self: Box<Self>) -> Response
pub fn into_response(self: Box<Self>) -> Response
Converts the error into Response.