Trait finchers_runtime::service::NewHttpService
[−]
[src]
pub trait NewHttpService { type RequestBody; type ResponseBody; type Error; type Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>; type InitError; type Future: Future<Item = Self::Service, Error = Self::InitError>; fn new_service(&self) -> Self::Future; }
A factory of an asynchronous HTTP service.
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 the service.
type Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>
The type of HttpService
to be created by this factory.
type InitError
The type of error which will occur during creating an HTTP service.
type Future: Future<Item = Self::Service, Error = Self::InitError>
A Future
which will be returned from new_service
and resolved as a Service
.
Required Methods
fn new_service(&self) -> Self::Future
Create a new instance of HttpService
asynchronously.
Implementations on Foreign Types
impl<S: NewHttpService> NewHttpService for Box<S>
[src]
type RequestBody = S::RequestBody
type ResponseBody = S::ResponseBody
type Error = S::Error
type Service = S::Service
type Future = S::Future
type InitError = S::InitError
fn new_service(&self) -> Self::Future
[src]
impl<S: NewHttpService> NewHttpService for Arc<S>
[src]
type RequestBody = S::RequestBody
type ResponseBody = S::ResponseBody
type Error = S::Error
type Service = S::Service
type Future = S::Future
type InitError = S::InitError
fn new_service(&self) -> Self::Future
[src]
Implementors
impl<E> NewHttpService for NewEndpointService<E> where
E: Endpoint,
E::Output: Responder, type RequestBody = RequestBody; type ResponseBody = ResponseBody; type Error = Error; type Service = EndpointService<E>; type InitError = Error; type Future = FutureResult<Self::Service, Self::InitError>;