Endpoint

Trait Endpoint 

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

Required Methods§

Source

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

Invoke the endpoint within the given context

Implementors§

Source§

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

Source§

impl<H, T> Endpoint for IntoEndpoint<H, T>
where H: Handler<T> + Clone + Send + Sync + 'static, T: 'static,