Skip to main content

SharedCfg

Struct SharedCfg 

Source
pub struct SharedCfg(/* private fields */);
Expand description

Shared configuration

Implementations§

Source§

impl SharedCfg

Source

pub fn new(tag: &'static str) -> SharedCfgBuilder

Construct new configuration

Source

pub fn id(&self) -> usize

Get unique shared cfg id

Source

pub fn tag(&self) -> &'static str

Get tag.

Source

pub fn service(&self) -> &'static str

Service name.

Source

pub fn get<T>(&self) -> Cfg<T>
where T: Configuration,

Get a reference to a previously inserted on configuration.

§Panics

if shared config is in building stage

Trait Implementations§

Source§

impl Clone for SharedCfg

Source§

fn clone(&self) -> SharedCfg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SharedCfg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for SharedCfg

Source§

fn default() -> SharedCfg

Returns the “default value” for a type. Read more
Source§

impl<T> From<SharedCfg> for Cfg<T>
where T: Configuration,

Source§

fn from(cfg: SharedCfg) -> Cfg<T>

Converts to this type from the input type.
Source§

impl From<SharedCfgBuilder> for SharedCfg

Source§

fn from(cfg: SharedCfgBuilder) -> SharedCfg

Converts to this type from the input type.
Source§

impl Hash for SharedCfg

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<S> Middleware<S, SharedCfg> for Compress

Source§

type Service = CompressMiddleware<S>

The middleware Service value created by this factory
Source§

fn create(&self, service: S, _: SharedCfg) -> Self::Service

Creates and returns a new middleware service.
Source§

fn apply<Fac, Req>( self, factory: Fac, ) -> ServiceChainFactory<ApplyMiddleware<Self, Fac, Cfg>, Req, Cfg>
where Fac: ServiceFactory<Req, Cfg, Service = Svc>, Cfg: Clone, Self: Sized, Self::Service: Service<Req>,

Creates a service factory that instantiates a service and applies the current middleware to it. Read more
Source§

impl<S> Middleware<S, SharedCfg> for DefaultHeaders

Source§

type Service = DefaultHeadersMiddleware<S>

The middleware Service value created by this factory
Source§

fn create(&self, service: S, _: SharedCfg) -> Self::Service

Creates and returns a new middleware service.
Source§

fn apply<Fac, Req>( self, factory: Fac, ) -> ServiceChainFactory<ApplyMiddleware<Self, Fac, Cfg>, Req, Cfg>
where Fac: ServiceFactory<Req, Cfg, Service = Svc>, Cfg: Clone, Self: Sized, Self::Service: Service<Req>,

Creates a service factory that instantiates a service and applies the current middleware to it. Read more
Source§

impl<S> Middleware<S, SharedCfg> for Logger

Source§

type Service = LoggerMiddleware<S>

The middleware Service value created by this factory
Source§

fn create(&self, service: S, _: SharedCfg) -> Self::Service

Creates and returns a new middleware service.
Source§

fn apply<Fac, Req>( self, factory: Fac, ) -> ServiceChainFactory<ApplyMiddleware<Self, Fac, Cfg>, Req, Cfg>
where Fac: ServiceFactory<Req, Cfg, Service = Svc>, Cfg: Clone, Self: Sized, Self::Service: Service<Req>,

Creates a service factory that instantiates a service and applies the current middleware to it. Read more
Source§

impl<S, Inner, Outer, Err> Middleware<S, SharedCfg> for WebStack<Inner, Outer, Err>
where Inner: Middleware<S, SharedCfg>, Outer: Middleware<Inner::Service, SharedCfg>, Outer::Service: Service<WebRequest<Err>, Response = WebResponse>,

Source§

type Service = WebMiddleware<<Outer as Middleware<<Inner as Middleware<S, SharedCfg>>::Service, SharedCfg>>::Service, Err>

The middleware Service value created by this factory
Source§

fn create(&self, service: S, cfg: SharedCfg) -> Self::Service

Creates and returns a new middleware service.
Source§

fn apply<Fac, Req>( self, factory: Fac, ) -> ServiceChainFactory<ApplyMiddleware<Self, Fac, Cfg>, Req, Cfg>
where Fac: ServiceFactory<Req, Cfg, Service = Svc>, Cfg: Clone, Self: Sized, Self::Service: Service<Req>,

Creates a service factory that instantiates a service and applies the current middleware to it. Read more
Source§

impl PartialEq for SharedCfg

Source§

fn eq(&self, other: &SharedCfg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A, T> ServiceFactory<A, SharedCfg> for Connector<A, T>

Source§

type Response = SimpleClient

Responses given by the created services.
Source§

type Error = Error<ClientError>

Errors produced by the created services.
Source§

type InitError = <T as ServiceFactory<Connect<A>, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

type Service = ConnectorService<A, <T as ServiceFactory<Connect<A>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<Connector<A, T> as ServiceFactory<A, SharedCfg>>::Service, <Connector<A, T> as ServiceFactory<A, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<A, S> ServiceFactory<Connect<A>, SharedCfg> for SslConnector<S>
where A: Address, S: ServiceFactory<Connect<A>, SharedCfg, Response = Io, Error = ConnectError>,

Source§

type Response = Io<Layer<SslFilter>>

Responses given by the created services.
Source§

type Error = ConnectError

Errors produced by the created services.
Source§

type Service = SslConnectorService<<S as ServiceFactory<Connect<A>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

type InitError = <S as ServiceFactory<Connect<A>, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<SslConnector<S> as ServiceFactory<Connect<A>, SharedCfg>>::Service, <SslConnector<S> as ServiceFactory<Connect<A>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<A, S> ServiceFactory<Connect<A>, SharedCfg> for SslConnector2<S>
where A: Address, S: ServiceFactory<Connect<A>, SharedCfg, Response = Io, Error = Error<ConnectError>>,

Source§

type Response = Io<Layer<SslFilter>>

Responses given by the created services.
Source§

type Error = Error<ConnectError>

Errors produced by the created services.
Source§

type Service = SslConnectorService2<<S as ServiceFactory<Connect<A>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

type InitError = <S as ServiceFactory<Connect<A>, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<SslConnector2<S> as ServiceFactory<Connect<A>, SharedCfg>>::Service, <SslConnector2<S> as ServiceFactory<Connect<A>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<A, S> ServiceFactory<Connect<A>, SharedCfg> for TlsConnector<S>
where A: Address, S: ServiceFactory<Connect<A>, SharedCfg, Response = Io, Error = ConnectError>,

Source§

type Response = Io<Layer<TlsClientFilter>>

Responses given by the created services.
Source§

type Error = ConnectError

Errors produced by the created services.
Source§

type Service = TlsConnectorService<<S as ServiceFactory<Connect<A>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

type InitError = <S as ServiceFactory<Connect<A>, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<TlsConnector<S> as ServiceFactory<Connect<A>, SharedCfg>>::Service, <TlsConnector<S> as ServiceFactory<Connect<A>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<A, S> ServiceFactory<Connect<A>, SharedCfg> for TlsConnector2<S>
where A: Address, S: ServiceFactory<Connect<A>, SharedCfg, Response = Io, Error = Error<ConnectError>>,

Source§

type Response = Io<Layer<TlsClientFilter>>

Responses given by the created services.
Source§

type Error = Error<ConnectError>

Errors produced by the created services.
Source§

type Service = TlsConnectorService2<<S as ServiceFactory<Connect<A>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

type InitError = <S as ServiceFactory<Connect<A>, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<TlsConnector2<S> as ServiceFactory<Connect<A>, SharedCfg>>::Service, <TlsConnector2<S> as ServiceFactory<Connect<A>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<T> ServiceFactory<Connect<T>, SharedCfg> for Connector<T>
where T: Address,

Source§

type Response = Io

Responses given by the created services.
Source§

type Error = ConnectError

Errors produced by the created services.
Source§

type Service = ConnectorService<T>

The type of Service produced by this factory.
Source§

type InitError = ConnectServiceError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<Connector<T> as ServiceFactory<Connect<T>, SharedCfg>>::Service, <Connector<T> as ServiceFactory<Connect<T>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<T> ServiceFactory<Connect<T>, SharedCfg> for Connector2<T>
where T: Address,

Source§

type Response = Io

Responses given by the created services.
Source§

type Error = Error<ConnectError>

Errors produced by the created services.
Source§

type Service = ConnectorService2<T>

The type of Service produced by this factory.
Source§

type InitError = ConnectServiceError

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<Connector2<T> as ServiceFactory<Connect<T>, SharedCfg>>::Service, <Connector2<T> as ServiceFactory<Connect<T>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl ServiceFactory<Connect, SharedCfg> for Connector

Source§

type Response = Connection

Responses given by the created services.
Source§

type Error = ConnectError

Errors produced by the created services.
Source§

type Service = ConnectorService

The type of Service produced by this factory.
Source§

type InitError = Box<dyn Error>

Possible errors encountered during service construction.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F, Err> ServiceFactory<Control<F, Err>, SharedCfg> for DefaultControlService
where F: Filter, Err: ResponseError,

Source§

type Response = ControlAck<F>

Responses given by the created services.
Source§

type Error = Error

Errors produced by the created services.
Source§

type Service = DefaultControlService

The type of Service produced by this factory.
Source§

type InitError = Error

Possible errors encountered during service construction.
Source§

async fn create(&self, _: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl ServiceFactory<Control<H2Error>, SharedCfg> for DefaultControlService

Source§

type Response = ControlAck

Responses given by the created services.
Source§

type Error = Error

Errors produced by the created services.
Source§

type Service = DefaultControlService

The type of Service produced by this factory.
Source§

type InitError = Error

Possible errors encountered during service construction.
Source§

async fn create(&self, _: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F, S, B, C> ServiceFactory<Io<F>, SharedCfg> for H1Service<F, S, B, C>
where F: Filter, S: ServiceFactory<Request, SharedCfg> + 'static, S::Error: ResponseError, S::Response: Into<Response<B>>, S::InitError: Debug, B: MessageBody, C: ServiceFactory<Control<F, S::Error>, SharedCfg, Response = ControlAck<F>> + 'static, C::Error: Error, C::InitError: Debug,

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = DispatchError

Errors produced by the created services.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

type Service = H1ServiceHandler<F, <S as ServiceFactory<Request, SharedCfg>>::Service, B, <C as ServiceFactory<Control<F, <S as ServiceFactory<Request, SharedCfg>>::Error>, SharedCfg>>::Service>

The type of Service produced by this factory.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F, S, B, C> ServiceFactory<Io<F>, SharedCfg> for H2Service<F, S, B, C>

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = DispatchError

Errors produced by the created services.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

type Service = H2ServiceHandler<F, <S as ServiceFactory<Request, SharedCfg>>::Service, B, C>

The type of Service produced by this factory.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F, S, B, C1, C2> ServiceFactory<Io<F>, SharedCfg> for HttpService<F, S, B, C1, C2>
where F: Filter, S: ServiceFactory<Request, SharedCfg> + 'static, S::Error: ResponseError, S::InitError: Debug, S::Response: Into<Response<B>>, B: MessageBody, C1: ServiceFactory<Control<F, S::Error>, SharedCfg, Response = ControlAck<F>> + 'static, C1::Error: Error, C1::InitError: Debug, C2: ServiceFactory<Control<H2Error>, SharedCfg, Response = ControlAck> + 'static, C2::Error: Error, C2::InitError: Debug,

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = DispatchError

Errors produced by the created services.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

type Service = HttpServiceHandler<F, <S as ServiceFactory<Request, SharedCfg>>::Service, B, <C1 as ServiceFactory<Control<F, <S as ServiceFactory<Request, SharedCfg>>::Error>, SharedCfg>>::Service, C2>

The type of Service produced by this factory.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F, Pub, Ctl> ServiceFactory<Io<F>, SharedCfg> for Server<Pub, Ctl>

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = ServerError<()>

Errors produced by the created services.
Source§

type Service = ServerHandler<Pub, Ctl>

The type of Service produced by this factory.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<Server<Pub, Ctl> as ServiceFactory<Io<F>, SharedCfg>>::Service, <Server<Pub, Ctl> as ServiceFactory<Io<F>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F> ServiceFactory<Io<F>, SharedCfg> for SslAcceptor
where F: Filter,

Source§

type Response = Io<Layer<SslFilter, F>>

Responses given by the created services.
Source§

type Error = Box<dyn Error>

Errors produced by the created services.
Source§

type Service = SslAcceptorService

The type of Service produced by this factory.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<SslAcceptor as ServiceFactory<Io<F>, SharedCfg>>::Service, <SslAcceptor as ServiceFactory<Io<F>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<F> ServiceFactory<Io<F>, SharedCfg> for TlsAcceptor
where F: Filter,

Source§

type Response = Io<Layer<TlsServerFilter, F>>

Responses given by the created services.
Source§

type Error = Error

Errors produced by the created services.
Source§

type Service = TlsAcceptorService

The type of Service produced by this factory.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<TlsAcceptor as ServiceFactory<Io<F>, SharedCfg>>::Service, <TlsAcceptor as ServiceFactory<Io<F>, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<Pub, Ctl> ServiceFactory<IoBoxed, SharedCfg> for Server<Pub, Ctl>

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = ServerError<()>

Errors produced by the created services.
Source§

type Service = ServerHandler<Pub, Ctl>

The type of Service produced by this factory.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

async fn create( &self, cfg: SharedCfg, ) -> Result<<Server<Pub, Ctl> as ServiceFactory<IoBoxed, SharedCfg>>::Service, <Server<Pub, Ctl> as ServiceFactory<IoBoxed, SharedCfg>>::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<Err: ErrorRenderer> ServiceFactory<WebRequest<Err>, SharedCfg> for Route<Err>

Source§

type Response = WebResponse

Responses given by the created services.
Source§

type Error = <Err as ErrorRenderer>::Container

Errors produced by the created services.
Source§

type InitError = ()

Possible errors encountered during service construction.
Source§

type Service = RouteService<Err>

The type of Service produced by this factory.
Source§

async fn create(&self, _: SharedCfg) -> Result<RouteService<Err>, ()>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl Eq for SharedCfg

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.