Trait actix_service::ServiceFactory [−][src]
Factory for creating Service
s.
Acts as a service factory. This is useful for cases where new Service
s
must be produced. One case is a TCP server listener. The listener
accepts new TCP streams, obtains a new Service
using the
ServiceFactory
trait, and uses the new Service
to process inbound
requests on that new TCP stream.
Config
is a service factory configuration type.
Associated Types
type Response
[src]
Responses given by the created services.
type Error
[src]
Errors produced by the created services.
type Config
[src]
Service factory configuration.
type Service: Service<Req, Response = Self::Response, Error = Self::Error>
[src]
The kind of Service
created by this factory.
type InitError
[src]
Errors potentially raised while building a service.
type Future: Future<Output = Result<Self::Service, Self::InitError>>
[src]
The future of the Service
instance.
Required methods
fn new_service(&self, cfg: Self::Config) -> Self::Future
[src]
Create and return a new service asynchronously.
Implementations on Foreign Types
impl<S, Req> ServiceFactory<Req> for Rc<S> where
S: ServiceFactory<Req>,
[src]
S: ServiceFactory<Req>,
type Response = S::Response
type Error = S::Error
type Config = S::Config
type Service = S::Service
type InitError = S::InitError
type Future = S::Future
fn new_service(&self, cfg: S::Config) -> S::Future
[src]
impl<S, Req> ServiceFactory<Req> for Arc<S> where
S: ServiceFactory<Req>,
[src]
S: ServiceFactory<Req>,
type Response = S::Response
type Error = S::Error
type Config = S::Config
type Service = S::Service
type InitError = S::InitError
type Future = S::Future
fn new_service(&self, cfg: S::Config) -> S::Future
[src]
Implementors
impl<C, Req, Res, Err, InitErr> ServiceFactory<Req> for BoxServiceFactory<C, Req, Res, Err, InitErr> where
Req: 'static,
Res: 'static,
Err: 'static,
InitErr: 'static,
[src]
Req: 'static,
Res: 'static,
Err: 'static,
InitErr: 'static,
type Response = Res
type Error = Err
type Config = C
type Service = BoxService<Req, Res, Err>
type InitError = InitErr
type Future = BoxFuture<Result<Self::Service, InitErr>>
fn new_service(&self, cfg: C) -> Self::Future
[src]
impl<SF, Req> ServiceFactory<Req> for PipelineFactory<SF, Req> where
SF: ServiceFactory<Req>,
[src]
SF: ServiceFactory<Req>,
type Config = SF::Config
type Response = SF::Response
type Error = SF::Error
type Service = SF::Service
type InitError = SF::InitError
type Future = SF::Future
fn new_service(&self, cfg: SF::Config) -> Self::Future
[src]
impl<T, S, Req> ServiceFactory<Req> for ApplyTransform<T, S, Req> where
S: ServiceFactory<Req>,
T: Transform<S::Service, Req, InitError = S::InitError>,
[src]
S: ServiceFactory<Req>,
T: Transform<S::Service, Req, InitError = S::InitError>,