Trait hyper::service::MakeService[][src]

pub trait MakeService<Ctx> {
    type ReqBody: Payload;
    type ResBody: Payload;
    type Error: Into<Box<dyn StdError + Send + Sync>>;
    type Service: Service<ReqBody = Self::ReqBody, ResBody = Self::ResBody, Error = Self::Error>;
    type Future: Future<Item = Self::Service, Error = Self::MakeError>;
    type MakeError: Into<Box<dyn StdError + Send + Sync>>;
    fn make_service(&mut self, ctx: Ctx) -> Self::Future;

    fn poll_ready(&mut self) -> Poll<(), Self::MakeError> { ... }
}

An asynchronous constructor of Services.

Associated Types

type ReqBody: Payload[src]

The Payload body of the http::Request.

type ResBody: Payload[src]

The Payload body of the http::Response.

type Error: Into<Box<dyn StdError + Send + Sync>>[src]

The error type that can be returned by Services.

type Service: Service<ReqBody = Self::ReqBody, ResBody = Self::ResBody, Error = Self::Error>[src]

The resolved Service from new_service().

type Future: Future<Item = Self::Service, Error = Self::MakeError>[src]

The future returned from new_service of a Service.

type MakeError: Into<Box<dyn StdError + Send + Sync>>[src]

The error type that can be returned when creating a new Service.

Loading content...

Required methods

fn make_service(&mut self, ctx: Ctx) -> Self::Future[src]

Create a new Service.

Loading content...

Provided methods

fn poll_ready(&mut self) -> Poll<(), Self::MakeError>[src]

Returns Ready when the constructor is ready to create a new Service.

The implementation of this method is allowed to return a Ready even if the factory is not ready to create a new service. In this case, the future returned from make_service will resolve to an error.

Loading content...

Implementors

impl<N, Ctx> MakeService<Ctx> for N where
    N: NewService, 
[src]

type ReqBody = N::ReqBody

type ResBody = N::ResBody

type Error = N::Error

type Service = N::Service

type Future = N::Future

type MakeError = N::InitError

Loading content...