Struct tower_http::catch_panic::CatchPanicLayer
source · pub struct CatchPanicLayer<T> { /* private fields */ }
Available on crate feature
catch-panic
only.Expand description
Layer that applies the CatchPanic
middleware that catches panics and converts them into
500 Internal Server
responses.
See the module docs for an example.
Implementations§
source§impl<T> CatchPanicLayer<T>
impl<T> CatchPanicLayer<T>
sourcepub fn custom(panic_handler: T) -> Selfwhere
T: ResponseForPanic,
pub fn custom(panic_handler: T) -> Selfwhere
T: ResponseForPanic,
Create a new CatchPanicLayer
with a custom panic handler.
Trait Implementations§
source§impl<T: Clone> Clone for CatchPanicLayer<T>
impl<T: Clone> Clone for CatchPanicLayer<T>
source§fn clone(&self) -> CatchPanicLayer<T>
fn clone(&self) -> CatchPanicLayer<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for CatchPanicLayer<T>
impl<T: Debug> Debug for CatchPanicLayer<T>
source§impl<T: Default> Default for CatchPanicLayer<T>
impl<T: Default> Default for CatchPanicLayer<T>
source§fn default() -> CatchPanicLayer<T>
fn default() -> CatchPanicLayer<T>
Returns the “default value” for a type. Read more