pub trait ControllerHandler<C, B> {
    type Responder: Responder;
    type Future: Future<Output = Self::Responder>;

    // Required method
    fn handle(&self, controller: &'static C, req: Request<B>) -> Self::Future;
}
Expand description

Trait that defines a handler within a controller. This trait is not meant to be implemented manually as there is a blanket implementation for Async Fns

Required Associated Types§

source

type Responder: Responder

An instance of a Responder being returned by the handler

source

type Future: Future<Output = Self::Responder>

Required Methods§

source

fn handle(&self, controller: &'static C, req: Request<B>) -> Self::Future

Handle the request dispatched from the Router

Implementors§

source§

impl<C, B, Fun, Fut, R> ControllerHandler<C, B> for Funwhere C: 'static, Fun: Fn(&'static C, Request<B>) -> Fut, Fut: 'static + Future<Output = R> + Send, R: Responder,

§

type Future = Box<dyn Future<Output = <Fun as ControllerHandler<C, B>>::Responder> + Unpin + Send + 'static, Global>

§

type Responder = R