Trait Endpoint

Source
pub trait Endpoint<Req: Request, Resp: Response>:
    Send
    + Sync
    + 'static {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        req: Req,
    ) -> Pin<Box<dyn Future<Output = HttpResult<Resp>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, req: Req, ) -> Pin<Box<dyn Future<Output = HttpResult<Resp>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<Req, Resp, F, Fut> Endpoint<Req, Resp> for F
where Req: Request, Resp: Response, F: 'static + Send + Clone + Sync + Fn(Req) -> Fut, Fut: Future<Output = HttpResult<Resp>> + 'static,