pub struct EitherService<SLeft, SRight> { /* private fields */ }
Expand description
Either service
Either service allows to use different services for handling requests
Implementations§
Trait Implementations§
Source§impl<SLeft: Clone, SRight: Clone> Clone for EitherService<SLeft, SRight>
impl<SLeft: Clone, SRight: Clone> Clone for EitherService<SLeft, SRight>
Source§fn clone(&self) -> EitherService<SLeft, SRight>
fn clone(&self) -> EitherService<SLeft, SRight>
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<SLeft, SRight> Debug for EitherService<SLeft, SRight>
impl<SLeft, SRight> Debug for EitherService<SLeft, SRight>
Source§impl<Req, SLeft, SRight> Service<Req> for EitherService<SLeft, SRight>
impl<Req, SLeft, SRight> Service<Req> for EitherService<SLeft, SRight>
Source§type Error = <SLeft as Service<Req>>::Error
type Error = <SLeft as Service<Req>>::Error
Errors produced by the service when polling readiness or executing call.
Source§async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
Returns when the service is able to process requests. Read more
Source§async fn call(
&self,
req: Req,
ctx: ServiceCtx<'_, Self>,
) -> Result<Self::Response, Self::Error>
async fn call( &self, req: Req, ctx: ServiceCtx<'_, Self>, ) -> Result<Self::Response, Self::Error>
Process the request and return the response asynchronously. Read more
Source§fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
Polls service from the current task. Read more
Auto Trait Implementations§
impl<SLeft, SRight> Freeze for EitherService<SLeft, SRight>
impl<SLeft, SRight> RefUnwindSafe for EitherService<SLeft, SRight>where
SLeft: RefUnwindSafe,
SRight: RefUnwindSafe,
impl<SLeft, SRight> Send for EitherService<SLeft, SRight>
impl<SLeft, SRight> Sync for EitherService<SLeft, SRight>
impl<SLeft, SRight> Unpin for EitherService<SLeft, SRight>
impl<SLeft, SRight> UnwindSafe for EitherService<SLeft, SRight>where
SLeft: UnwindSafe,
SRight: 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<Svc, Req> IntoService<Svc, Req> for Svcwhere
Svc: Service<Req>,
impl<Svc, Req> IntoService<Svc, Req> for Svcwhere
Svc: Service<Req>,
Source§fn into_service(self) -> Svc
fn into_service(self) -> Svc
Convert to a
Service