Trait finchers_runtime::service::HttpService
[−]
[src]
pub trait HttpService { type RequestBody; type ResponseBody; type Error; type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>; fn call(&mut self, request: Request<Self::RequestBody>) -> Self::Future; }
Trait representing an asynchronous function from an HTTP request to an HTTP response.
Associated Types
type RequestBody
The type of message body in the request.
type ResponseBody
The type of message body in the response.
type Error
The type of error which will be returned from this service.
type Future: Future<Item = Response<Self::ResponseBody>, Error = Self::Error>
A Future
which will be returned from call
and resolved as an HTTP response.
Required Methods
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.
Implementations on Foreign Types
impl<S: HttpService> HttpService for Box<S>
[src]
type RequestBody = S::RequestBody
type ResponseBody = S::ResponseBody
type Error = S::Error
type Future = S::Future
fn call(&mut self, request: Request<Self::RequestBody>) -> Self::Future
[src]
Implementors
impl<E> HttpService for EndpointService<E> where
E: Endpoint,
E::Output: Responder, type RequestBody = RequestBody; type ResponseBody = ResponseBody; type Error = Error; type Future = EndpointServiceFuture<E::Task>;