pub struct EitherServiceFactory<ChooseFn, SFLeft, SFRight> { /* private fields */ }
Expand description
Either service factory
Either service allows to use different services for handling requests
Implementations§
Source§impl<ChooseFn, SFLeft, SFRight> EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> EitherServiceFactory<ChooseFn, SFLeft, SFRight>
Trait Implementations§
Source§impl<ChooseFn: Clone, SFLeft: Clone, SFRight: Clone> Clone for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn: Clone, SFLeft: Clone, SFRight: Clone> Clone for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
Source§fn clone(&self) -> EitherServiceFactory<ChooseFn, SFLeft, SFRight>
fn clone(&self) -> EitherServiceFactory<ChooseFn, SFLeft, SFRight>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<ChooseFn, SFLeft, SFRight> Debug for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> Debug for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
Source§impl<R, C, ChooseFn, SFLeft, SFRight> ServiceFactory<R, C> for EitherServiceFactory<ChooseFn, SFLeft, SFRight>where
ChooseFn: Fn(&C) -> bool,
SFLeft: ServiceFactory<R, C>,
SFRight: ServiceFactory<R, C, Response = SFLeft::Response, InitError = SFLeft::InitError, Error = SFLeft::Error>,
impl<R, C, ChooseFn, SFLeft, SFRight> ServiceFactory<R, C> for EitherServiceFactory<ChooseFn, SFLeft, SFRight>where
ChooseFn: Fn(&C) -> bool,
SFLeft: ServiceFactory<R, C>,
SFRight: ServiceFactory<R, C, Response = SFLeft::Response, InitError = SFLeft::InitError, Error = SFLeft::Error>,
Source§type Response = <SFLeft as ServiceFactory<R, C>>::Response
type Response = <SFLeft as ServiceFactory<R, C>>::Response
Responses given by the created services.
Source§type Error = <SFLeft as ServiceFactory<R, C>>::Error
type Error = <SFLeft as ServiceFactory<R, C>>::Error
Errors produced by the created services.
Source§type InitError = <SFLeft as ServiceFactory<R, C>>::InitError
type InitError = <SFLeft as ServiceFactory<R, C>>::InitError
Errors potentially raised while building a service.
Source§type Service = EitherService<<SFLeft as ServiceFactory<R, C>>::Service, <SFRight as ServiceFactory<R, C>>::Service>
type Service = EitherService<<SFLeft as ServiceFactory<R, C>>::Service, <SFRight as ServiceFactory<R, C>>::Service>
The kind of
Service
created by this factory.Source§async fn create(&self, cfg: C) -> Result<Self::Service, Self::InitError>
async fn create(&self, cfg: C) -> Result<Self::Service, Self::InitError>
Create and return a new service value asynchronously.
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,
Create and return a new service value asynchronously and wrap into 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>
Map this service’s output to a different type, returning a new service
of the resulting 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>
Map this service’s error to a different error, returning 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>
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<ChooseFn, SFLeft, SFRight> Freeze for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> RefUnwindSafe for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> Send for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> Sync for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> Unpin for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
impl<ChooseFn, SFLeft, SFRight> UnwindSafe for EitherServiceFactory<ChooseFn, SFLeft, SFRight>
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