Trait actix_net::service::NewService
source · 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§
Required Methods§
sourcefn new_service(&self) -> Self::Future
fn new_service(&self) -> Self::Future
Create and return a new service value asynchronously.