pub trait Handler: Send + Sync {
    type RespBody: Body;
    type Error: Into<Box<dyn Error + Send + Sync>>;

    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        req: Request<ReqBody>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::RespBody>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

source

fn call<'life0, 'async_trait>( &'life0 self, req: Request<ReqBody> ) -> Pin<Box<dyn Future<Output = Result<Response<Self::RespBody>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<RespBody, Err, F, Fut> Handler for HandlerFn<F>where RespBody: Body, F: Fn(Request<ReqBody>) -> Fut + Send + Sync, Err: Into<Box<dyn Error + Send + Sync>>, Fut: Future<Output = Result<Response<RespBody>, Err>> + Send,

§

type RespBody = RespBody

§

type Error = Err