pub struct ApplyMiddleware<M, Fac, Cfg>(/* private fields */);Expand description
Apply middleware to a service factory.
Trait Implementations§
Source§impl<M, Fac, Cfg> Clone for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> Clone for ApplyMiddleware<M, Fac, Cfg>
Source§impl<M, Fac, Cfg> Debug for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> Debug for ApplyMiddleware<M, Fac, Cfg>
Source§impl<M, Fac, Req, Cfg> ServiceFactory<Req, Cfg> for ApplyMiddleware<M, Fac, Cfg>where
Fac: ServiceFactory<Req, Cfg>,
M: Middleware<Fac::Service, Cfg>,
M::Service: Service<Req>,
Cfg: Clone,
impl<M, Fac, Req, Cfg> ServiceFactory<Req, Cfg> for ApplyMiddleware<M, Fac, Cfg>where
Fac: ServiceFactory<Req, Cfg>,
M: Middleware<Fac::Service, Cfg>,
M::Service: Service<Req>,
Cfg: Clone,
Source§type Response = <<M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service as Service<Req>>::Response
type Response = <<M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service as Service<Req>>::Response
Responses given by the created services.
Source§type Error = <<M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service as Service<Req>>::Error
type Error = <<M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service as Service<Req>>::Error
Errors produced by the created services.
Source§type Service = <M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service
type Service = <M as Middleware<<Fac as ServiceFactory<Req, Cfg>>::Service, Cfg>>::Service
The type of
Service produced by this factory.Source§type InitError = <Fac as ServiceFactory<Req, Cfg>>::InitError
type InitError = <Fac as ServiceFactory<Req, Cfg>>::InitError
Possible errors encountered during service construction.
Source§async fn create(&self, cfg: Cfg) -> Result<Self::Service, Self::InitError>
async fn create(&self, cfg: Cfg) -> 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,
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>
fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
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>
fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
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>
fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Maps this factory’s initialization error to a different error,
returning a new service factory.
Auto Trait Implementations§
impl<M, Fac, Cfg> Freeze for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> RefUnwindSafe for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> !Send for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> !Sync for ApplyMiddleware<M, Fac, Cfg>
impl<M, Fac, Cfg> Unpin for ApplyMiddleware<M, Fac, Cfg>where
Cfg: Unpin,
impl<M, Fac, Cfg> UnwindSafe for ApplyMiddleware<M, Fac, Cfg>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for Twhere
T: ServiceFactory<Req, Cfg>,
impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for Twhere
T: ServiceFactory<Req, Cfg>,
Source§fn into_factory(self) -> T
fn into_factory(self) -> T
Convert
Self to a ServiceFactory