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
Source§impl<T, S> Layer<S> for CatchPanicLayer<T>where
T: Clone,
impl<T, S> Layer<S> for CatchPanicLayer<T>where
T: Clone,
impl<T: Copy> Copy for CatchPanicLayer<T>
Auto Trait Implementations§
impl<T> Freeze for CatchPanicLayer<T>where
T: Freeze,
impl<T> RefUnwindSafe for CatchPanicLayer<T>where
T: RefUnwindSafe,
impl<T> Send for CatchPanicLayer<T>where
T: Send,
impl<T> Sync for CatchPanicLayer<T>where
T: Sync,
impl<T> Unpin for CatchPanicLayer<T>where
T: Unpin,
impl<T> UnwindSafe for CatchPanicLayer<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more