Trait tower_http::catch_panic::ResponseForPanic
source · [−]pub trait ResponseForPanic: Clone {
type ResponseBody;
fn response_for_panic(
&mut self,
err: Box<dyn Any + Send + 'static>
) -> Response<Self::ResponseBody>;
}
This is supported on crate feature
catch-panic
only.Expand description
Trait for creating responses from panics.
Associated Types
type ResponseBody
type ResponseBody
The body type used for responses to panics.
Required methods
fn response_for_panic(
&mut self,
err: Box<dyn Any + Send + 'static>
) -> Response<Self::ResponseBody>
fn response_for_panic(
&mut self,
err: Box<dyn Any + Send + 'static>
) -> Response<Self::ResponseBody>
Create a response from the panic error.