Trait NewHttpService

Source
pub trait NewHttpService: Sealed {
    type RequestBody: BufStream;
    type ResponseBody: BufStream;
    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_http_service(&self) -> Self::Future;
}
Expand description

Creates HttpService values.

This is not intended to be implemented directly. Instead, it is a trait alias of sorts, aliasing tower_service::NewService trait with http::Request and http::Response types.

Required Associated Types§

Source

type RequestBody: BufStream

The HTTP request body handled by the service.

Source

type ResponseBody: BufStream

The HTTP response body returned by the service.

Source

type Error

Errors produced by the service

Source

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

The Service value created by this factory

Source

type InitError

Errors produced while building a service.

Source

type Future: Future<Item = Self::Service, Error = Self::InitError>

The future of the Service instance.

Required Methods§

Source

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

Create and return a new service value asynchronously.

Implementors§

Source§

impl<T, B1, B2> NewHttpService for T
where T: NewService<Request = Request<B1>, Response = Response<B2>>, B1: BufStream, B2: BufStream,