NewHttpService

Trait NewHttpService 

Source
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>;

    // Required method
    fn new_service(&self) -> Self::Future;
}
Expand description

A factory of an asynchronous HTTP service.

Required Associated Types§

Source

type RequestBody

The type of message body in the request.

Source

type ResponseBody

The type of message body in the response.

Source

type Error

The type of error which will be returned from the service.

Source

type Service: HttpService<RequestBody = Self::RequestBody, ResponseBody = Self::ResponseBody, Error = Self::Error>

The type of HttpService to be created by this factory.

Source

type InitError

The type of error which will occur during creating an HTTP service.

Source

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§

Source

fn new_service(&self) -> Self::Future

Create a new instance of HttpService asynchronously.

Implementations on Foreign Types§

Source§

impl<S: NewHttpService> NewHttpService for Box<S>

Source§

impl<S: NewHttpService> NewHttpService for Arc<S>

Implementors§