pub trait NewService {
    type Request;
    type Response;
    type Error;
    type Service: Service<Request = Self::Request, Response = Self::Response, Error = Self::Error>;
    type InitError;
    type Future: Future<Item = Self::Service, Error = Self::InitError>;

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

re-export for convinience Creates new Service values.

Acts as a service factory. This is useful for cases where new Service values must be produced. One case is a TCP servier listener. The listner accepts new TCP streams, obtains a new Service value using the NewService trait, and uses that new Service value to process inbound requests on that new TCP stream.

Required Associated Types§

Requests handled by the service

Responses given by the service

Errors produced by the service

The Service value created by this factory

Errors produced while building a service.

The future of the Service instance.

Required Methods§

Create and return a new service value asynchronously.

Implementations on Foreign Types§

Implementors§