Struct salvo::prelude::CatchPanic
source · pub struct CatchPanic {}
Available on crate feature
catch-panic
only.Expand description
This middleware catches panics and write 500 INTERNAL SERVER ERROR
into response. This middleware should be used as the first middleware.
Implementations§
source§impl CatchPanic
impl CatchPanic
sourcepub fn new() -> CatchPanic
pub fn new() -> CatchPanic
Create new CatchPanic
middleware.
Trait Implementations§
source§impl Debug for CatchPanic
impl Debug for CatchPanic
source§impl Default for CatchPanic
impl Default for CatchPanic
source§fn default() -> CatchPanic
fn default() -> CatchPanic
Returns the “default value” for a type. Read more
source§impl Handler for CatchPanic
impl Handler for CatchPanic
source§fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
CatchPanic: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
CatchPanic: 'async_trait,
Handle http request.
Auto Trait Implementations§
impl Freeze for CatchPanic
impl RefUnwindSafe for CatchPanic
impl Send for CatchPanic
impl Sync for CatchPanic
impl Unpin for CatchPanic
impl UnwindSafe for CatchPanic
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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