pub struct CatchPanicLayer<T> { /* private fields */ }
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 CatchPanicLayer<DefaultResponseForPanic>
impl CatchPanicLayer<DefaultResponseForPanic>
Sourcepub fn new() -> CatchPanicLayer<DefaultResponseForPanic>
pub fn new() -> CatchPanicLayer<DefaultResponseForPanic>
Create a new CatchPanicLayer
with the default panic handler.
Source§impl<T> CatchPanicLayer<T>
impl<T> CatchPanicLayer<T>
Sourcepub fn custom(panic_handler: T) -> CatchPanicLayer<T>where
T: ResponseForPanic,
pub fn custom(panic_handler: T) -> CatchPanicLayer<T>where
T: ResponseForPanic,
Create a new CatchPanicLayer
with a custom panic handler.
Trait Implementations§
Source§impl<T> Clone for CatchPanicLayer<T>where
T: Clone,
impl<T> Clone for CatchPanicLayer<T>where
T: Clone,
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 for CatchPanicLayer<T>where
T: Debug,
impl<T> Debug for CatchPanicLayer<T>where
T: Debug,
Source§impl<T> Default for CatchPanicLayer<T>where
T: Default,
impl<T> Default for CatchPanicLayer<T>where
T: Default,
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,
Source§type Service = CatchPanic<S, T>
type Service = CatchPanic<S, T>
The wrapped service
impl<T> Copy for CatchPanicLayer<T>where
T: Copy,
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