[][src]Trait tower_web::util::http::NewHttpService

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>;
    fn new_http_service(&self) -> Self::Future;
}

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.

Associated Types

type RequestBody: BufStream

The HTTP request body handled by the service.

type ResponseBody: BufStream

The HTTP response body returned by the service.

type Error

Errors produced by the service

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

The Service value created by this factory

type InitError

Errors produced while building a service.

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

The future of the Service instance.

Loading content...

Required methods

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

Create and return a new service value asynchronously.

Loading content...

Implementors

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

type RequestBody = B1

type ResponseBody = B2

type Error = T::Error

type Service = T::Service

type InitError = T::InitError

type Future = T::Future

Loading content...