Struct salvo_core::catcher::Catcher
source · pub struct Catcher { /* private fields */ }
Expand description
Catcher
is used to catch errors.
View module level documentation for more details.
Implementations§
source§impl Catcher
impl Catcher
sourcepub fn hoops_mut(&mut self) -> &mut Vec<Arc<dyn Handler>>
pub fn hoops_mut(&mut self) -> &mut Vec<Arc<dyn Handler>>
Get current catcher’s middlewares mutable reference.
sourcepub fn hoop<H: Handler>(self, hoop: H) -> Self
pub fn hoop<H: Handler>(self, hoop: H) -> Self
Add a handler as middleware, it will run the handler when error catched.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Catcher
impl !RefUnwindSafe for Catcher
impl Send for Catcher
impl Sync for Catcher
impl Unpin for Catcher
impl !UnwindSafe for Catcher
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