pub trait HttpService<ReqBody>: Sealed<ReqBody> { type ResBody: Body; type Error: Into<Box<dyn StdError + Send + Sync>>; type Future: Future<Output = Result<Response<Self::ResBody>, Self::Error>>; }
An asynchronous function from Request to Response.
Request
Response
The Body body of the http::Response.
Body
http::Response
The error type that can occur within this Service.
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.
Error
The Future returned by this Service.
Future