pub trait ResponseForPanic: Clone {
type ResponseBody;
// Required method
fn response_for_panic(
&mut self,
err: Box<dyn Any + Send + 'static>,
) -> Response<Self::ResponseBody>;
}
Available on crate feature
catch-panic
only.Expand description
Trait for creating responses from panics.
Required Associated Types§
Sourcetype ResponseBody
type ResponseBody
The body type used for responses to panics.
Required Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.