pub trait HttpService {
type RequestBody;
type ResponseBody;
type Error;
type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>;
// Required method
fn call(&mut self, request: Request<Self::RequestBody>) -> Self::Future;
}Expand description
Trait representing an asynchronous function from an HTTP request to an HTTP response.
Required Associated Types§
Sourcetype RequestBody
type RequestBody
The type of message body in the request.
Sourcetype ResponseBody
type ResponseBody
The type of message body in the response.
Required Methods§
Sourcefn call(&mut self, request: Request<Self::RequestBody>) -> Self::Future
fn call(&mut self, request: Request<Self::RequestBody>) -> Self::Future
Apply an HTTP request to this service and get a future which will be resolved as an HTTP response.