Endpoint

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>> + Send + '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>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trait Implementations§

Source§

impl<Req: Request, Resp: Response> Endpoint<Req, Resp> for Box<dyn Endpoint<Req, Resp>>

Source§

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

Implementations on Foreign Types§

Source§

impl<Req: Request, Resp: Response> Endpoint<Req, Resp> for Box<dyn Endpoint<Req, Resp>>

Source§

fn call<'life0, 'async_trait>( &'life0 self, request: Req, ) -> Pin<Box<dyn Future<Output = HttpResult<Resp>> + Send + '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>> + Send + 'static,