pub struct Either<A, B> { /* private fields */ }Expand description
Combine two different new service types into a single service.
Implementations§
Trait Implementations§
Source§impl<A, B> ServiceFactory for Either<A, B>where
A: ServiceFactory,
A::Config: Clone,
B: ServiceFactory<Config = A::Config, Response = A::Response, Error = A::Error, InitError = A::InitError>,
impl<A, B> ServiceFactory for Either<A, B>where
A: ServiceFactory,
A::Config: Clone,
B: ServiceFactory<Config = A::Config, Response = A::Response, Error = A::Error, InitError = A::InitError>,
Source§type Request = Either<<A as ServiceFactory>::Request, <B as ServiceFactory>::Request>
type Request = Either<<A as ServiceFactory>::Request, <B as ServiceFactory>::Request>
Requests handled by the service.
Source§type Response = <A as ServiceFactory>::Response
type Response = <A as ServiceFactory>::Response
Responses given by the service
Source§type Error = <A as ServiceFactory>::Error
type Error = <A as ServiceFactory>::Error
Errors produced by the service
Source§type InitError = <A as ServiceFactory>::InitError
type InitError = <A as ServiceFactory>::InitError
Errors produced while building a service.
Source§type Config = <A as ServiceFactory>::Config
type Config = <A as ServiceFactory>::Config
Service factory configuration
Source§type Service = EitherService<<A as ServiceFactory>::Service, <B as ServiceFactory>::Service>
type Service = EitherService<<A as ServiceFactory>::Service, <B as ServiceFactory>::Service>
The
Service value created by this factorySource§fn new_service(&self, cfg: A::Config) -> Self::Future
fn new_service(&self, cfg: A::Config) -> Self::Future
Create and return a new service value asynchronously.
Source§fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
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) -> MapErrServiceFactory<Self, F, E>
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E>
Map this service’s error to a different error, returning a new service.
Source§fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<A, B> Freeze for Either<A, B>
impl<A, B> RefUnwindSafe for Either<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B>
impl<A, B> Sync for Either<A, B>
impl<A, B> Unpin for Either<A, B>
impl<A, B> UnwindSafe for Either<A, B>where
A: UnwindSafe,
B: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
Source§fn into_factory(self) -> T
fn into_factory(self) -> T
Convert
Self to a ServiceFactory