#[non_exhaustive]pub struct HoopedHandler { /* private fields */ }Expand description
Handler that wrap Handler to let it use middlewares.
Implementations§
Source§impl HoopedHandler
impl HoopedHandler
Sourcepub fn new<H>(inner: H) -> HoopedHandlerwhere
H: Handler,
pub fn new<H>(inner: H) -> HoopedHandlerwhere
H: Handler,
Create new HoopedHandler.
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>(self, hoop: H) -> HoopedHandlerwhere
H: Handler,
pub fn hoop<H>(self, hoop: H) -> HoopedHandlerwhere
H: Handler,
Add a handler as middleware, it will run the handler when error catched.
Trait Implementations§
Source§impl Handler for HoopedHandler
impl Handler for HoopedHandler
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,
HoopedHandler: '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,
HoopedHandler: 'async_trait,
Handle http request.
Source§fn arc(self) -> ArcHandlerwhere
Self: Sized,
fn arc(self) -> ArcHandlerwhere
Self: Sized,
Wrap to
ArcHandler.Source§fn hoop<H>(self, hoop: H) -> HoopedHandler
fn hoop<H>(self, hoop: H) -> HoopedHandler
Hoop this handler with middleware.
Auto Trait Implementations§
impl Freeze for HoopedHandler
impl !RefUnwindSafe for HoopedHandler
impl Send for HoopedHandler
impl Sync for HoopedHandler
impl Unpin for HoopedHandler
impl !UnwindSafe for HoopedHandler
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