pub struct EitherService<SLeft, SRight> { /* private fields */ }Expand description
Either service
Either service allows to use different services for handling requests
Implementations§
Source§impl<SLeft, SRight> EitherService<SLeft, SRight>
impl<SLeft, SRight> EitherService<SLeft, SRight>
Sourcepub fn left(svc: SLeft) -> EitherService<SLeft, SRight>
pub fn left(svc: SLeft) -> EitherService<SLeft, SRight>
Create Either service
Sourcepub fn right(svc: SRight) -> EitherService<SLeft, SRight>
pub fn right(svc: SRight) -> EitherService<SLeft, SRight>
Create Either service
Trait Implementations§
Source§impl<SLeft, SRight> Clone for EitherService<SLeft, SRight>
impl<SLeft, SRight> 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<'_, EitherService<SLeft, SRight>>,
) -> Result<(), <EitherService<SLeft, SRight> as Service<Req>>::Error>
async fn ready( &self, ctx: ServiceCtx<'_, EitherService<SLeft, SRight>>, ) -> Result<(), <EitherService<SLeft, SRight> as Service<Req>>::Error>
Returns when the service is ready to process requests. Read more
Source§async fn call(
&self,
req: Req,
ctx: ServiceCtx<'_, EitherService<SLeft, SRight>>,
) -> Result<<EitherService<SLeft, SRight> as Service<Req>>::Response, <EitherService<SLeft, SRight> as Service<Req>>::Error>
async fn call( &self, req: Req, ctx: ServiceCtx<'_, EitherService<SLeft, SRight>>, ) -> Result<<EitherService<SLeft, SRight> as Service<Req>>::Response, <EitherService<SLeft, SRight> as Service<Req>>::Error>
Processes a request and returns the response asynchronously. Read more
Source§fn poll(
&self,
cx: &mut Context<'_>,
) -> Result<(), <EitherService<SLeft, SRight> as Service<Req>>::Error>
fn poll( &self, cx: &mut Context<'_>, ) -> Result<(), <EitherService<SLeft, SRight> as Service<Req>>::Error>
Polls the service from the current async 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> UnsafeUnpin for EitherService<SLeft, SRight>where
SLeft: UnsafeUnpin,
SRight: UnsafeUnpin,
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