Trait Service

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

A service converts an HTTP request into a response.

Required Methods§

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

Converts a request into a response.

Implementors§

§

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

§

impl<S> Service<Request<Body>, Response<Body>> for S
where S: Service<Request<Body>, Response = Response<Body>>, <S as Service<Request<Body>>>::Future: Send + 'static, <S as Service<Request<Body>>>::Error: Display + Send + 'static,