Trait hyper::service::Service[][src]

pub trait Service {
    type ReqBody: Payload;
    type ResBody: Payload;
    type Error: Into<Box<StdError + Send + Sync>>;
    type Future: Future<Item = Response<Self::ResBody>, Error = Self::Error>;
    fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future;
}

An asynchronous function from Request to Response.

Associated Types

The Payload body of the http::Request.

The Payload body of the http::Response.

The error type that can occur within this Service.

Note: Returning an Error to a hyper server will cause the connection to be abruptly aborted. In most cases, it is better to return a Response with a 4xx or 5xx status code.

The Future returned by this Service.

Required Methods

Calls this Service with a request, returning a Future of the response.

Implementors