pub trait Handler:
Send
+ Sync
+ 'static {
// Required method
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,
Self: 'async_trait;
// Provided methods
fn arc(self) -> ArcHandler
where Self: Sized { ... }
fn hooped<H>(self) -> HoopedHandler
where H: Handler,
Self: Sized { ... }
fn hoop<H>(self, hoop: H) -> HoopedHandler
where H: Handler,
Self: Sized { ... }
fn hoop_when<H, F>(self, hoop: H, filter: F) -> HoopedHandler
where Self: Sized,
H: Handler,
F: Fn(&Request, &Depot) -> bool + Send + Sync + 'static { ... }
}
Expand description
Handler
is used for handle Request
.
View module level documentation for more details.
Required Methods§
Sourcefn 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,
Self: '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,
Self: 'async_trait,
Handle http request.
Provided Methods§
Sourcefn arc(self) -> ArcHandlerwhere
Self: Sized,
fn arc(self) -> ArcHandlerwhere
Self: Sized,
Wrap to ArcHandler
.
Sourcefn hooped<H>(self) -> HoopedHandler
fn hooped<H>(self) -> HoopedHandler
Wrap to HoopedHandler
.
Sourcefn hoop<H>(self, hoop: H) -> HoopedHandler
fn hoop<H>(self, hoop: H) -> HoopedHandler
Hoop this handler with middleware.