pub trait Service<Request, Response> {
    // Required method
    fn run(
        &mut self,
        req: Request,
    ) -> Pin<Box<dyn Future<Output = Response> + Send>>;
}
Expand description

A service converts an HTTP request into a response.

Required Methods§

Source

fn run( &mut self, req: Request, ) -> Pin<Box<dyn Future<Output = Response> + Send>>

Converts a request into a response.

Implementors§

Source§

impl<Req, Res> Service<Req, Res> for ServerFnTraitObj<Req, Res>
where Req: Send + 'static, Res: 'static,