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§

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 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,

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 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)
where A: Handler, B: Handler,

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 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)
where A: Handler, B: Handler, C: Handler,

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 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)
where A: Handler, B: Handler, C: Handler, D: Handler,

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 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)
where A: Handler, B: Handler, C: Handler, D: Handler, E: Handler,

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 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)
where A: Handler, B: Handler, C: Handler, D: Handler, E: Handler, F: Handler,

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 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)
where A: Handler, B: Handler, C: Handler, D: Handler, E: Handler, F: Handler, G: Handler,

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 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)
where A: Handler, B: Handler, C: Handler, D: Handler, E: Handler, F: Handler, G: Handler, H: Handler,

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 Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Implementors§

source§

impl Handler for DefaultGoal

source§

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.
source§

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.