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

pub trait MakeService<Target, ReqBody>: Sealed<Target, ReqBody> {
    type ResBody: Payload;
    type Error: Into<Box<dyn StdError + Send + Sync>>;
    type Service: Service<ReqBody, ResBody = Self::ResBody, Error = Self::Error>;
    type Future: Future<Output = Result<Self::Service, Self::MakeError>>;
    type MakeError: Into<Box<dyn StdError + Send + Sync>>;
    fn poll_ready(
        &mut self,
        cx: &mut Context
    ) -> Poll<Result<(), Self::MakeError>>;
fn make_service(&mut self, target: Target) -> Self::Future; }

An asynchronous constructor of Services.

Associated Types

type ResBody: Payload

The Payload body of the http::Response.

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

The error type that can be returned by Services.

type Service: Service<ReqBody, ResBody = Self::ResBody, Error = Self::Error>

The resolved Service from make_service().

type Future: Future<Output = Result<Self::Service, Self::MakeError>>

The future returned from new_service of a Service.

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

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

Loading content...

Required methods

fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), Self::MakeError>>

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.

fn make_service(&mut self, target: Target) -> Self::Future

Create a new Service.

Loading content...

Implementors

impl<T, Target, S, B1, B2, E, F> MakeService<Target, B1> for T where
    T: for<'a> Service<&'a Target, Response = S, Error = E, Future = F>,
    S: Service<Request<B1>, Response = Response<B2>>,
    E: Into<Box<dyn Error + Send + Sync>>,
    S::Error: Into<Box<dyn Error + Send + Sync>>,
    B1: Payload,
    B2: Payload,
    F: Future<Output = Result<S, E>>, 
[src]

type ResBody = B2

type Error = S::Error

type Service = S

type Future = F

type MakeError = E

Loading content...