Trait salvo_core::handler::Handler
source · 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 Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: '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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Handle http request.
Implementations on Foreign Types§
source§impl<A> Handler for (A,)where
A: Handler,
impl<A> Handler for (A,)where
A: Handler,
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B> Handler for (A, B)
impl<A, B> Handler for (A, B)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C> Handler for (A, B, C)
impl<A, B, C> Handler for (A, B, C)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C, D> Handler for (A, B, C, D)
impl<A, B, C, D> Handler for (A, B, C, D)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C, D, E> Handler for (A, B, C, D, E)
impl<A, B, C, D, E> Handler for (A, B, C, D, E)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C, D, E, F> Handler for (A, B, C, D, E, F)
impl<A, B, C, D, E, F> Handler for (A, B, C, D, E, F)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C, D, E, F, G> Handler for (A, B, C, D, E, F, G)
impl<A, B, C, D, E, F, G> Handler for (A, B, C, D, E, F, G)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
source§impl<A, B, C, D, E, F, G, H> Handler for (A, B, C, D, E, F, G, H)
impl<A, B, C, D, E, F, G, H> Handler for (A, B, C, D, E, F, G, H)
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
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Implementors§
impl Handler for DefaultGoal
impl<Svc, QB, SB, E> Handler for TowerLayerHandler<Svc, QB>where
QB: TryFrom<ReqBody> + Body + Send + Sync + 'static,
<QB as TryFrom<ReqBody>>::Error: StdError + Send + Sync + 'static,
SB: Body + Send + Sync + 'static,
SB::Data: Into<Bytes> + Send + Debug + 'static,
SB::Error: StdError + Send + Sync + 'static,
E: StdError + Send + Sync + 'static,
Svc: Service<Request<QB>, Response = Response<SB>> + Send + 'static,
Svc::Future: Future<Output = Result<Response<SB>, E>> + Send + 'static,
Svc::Error: StdError + Send + Sync,
Available on crate feature
tower-compat
only.impl<Svc, QB, SB, E, Fut> Handler for TowerServiceHandler<Svc, QB>where
QB: TryFrom<ReqBody> + Body + Send + Sync + 'static,
<QB as TryFrom<ReqBody>>::Error: StdError + Send + Sync + 'static,
SB: Body + Send + Sync + 'static,
SB::Data: Into<Bytes> + Send + Debug + 'static,
SB::Error: StdError + Send + Sync + 'static,
E: StdError + Send + Sync + 'static,
Svc: Service<Request<QB>, Response = Response<SB>, Future = Fut> + Send + Sync + Clone + 'static,
Svc::Error: StdError + Send + Sync + 'static,
Fut: Future<Output = Result<Response<SB>, E>> + Send + 'static,
Available on crate feature
tower-compat
only.