[][src]Trait saphir::controller::ControllerHandler

pub trait ControllerHandler<C, B> {
    type Responder: Responder;
    type Future: Future<Output = Self::Responder>;
    fn handle(&self, controller: &'static C, req: Request<B>) -> Self::Future;
}

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

Associated Types

type Responder: Responder

An instance of a Responder being returned by the handler

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

Loading content...

Required methods

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

Handle the request dispatched from the Router

Loading content...

Implementors

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

type Future = Box<dyn Future<Output = Self::Responder> + Unpin + Send>

type Responder = R

Loading content...