Enum actix_net::either::EitherService [−][src]
pub enum EitherService<A, B> { A(A), B(B), }
Combine two different service types into a single type.
Both services must be of the same request, response, and error types.
EitherService
is useful for handling conditional branching in service
middleware to different inner service types.
Variants
A(A)
B(B)
Trait Implementations
impl<A, B> Service for EitherService<A, B> where
A: Service,
B: Service<Request = A::Request, Response = A::Response, Error = A::Error>,
[src]
impl<A, B> Service for EitherService<A, B> where
A: Service,
B: Service<Request = A::Request, Response = A::Response, Error = A::Error>,
type Request = A::Request
Requests handled by the service.
type Response = A::Response
Responses given by the service.
type Error = A::Error
Errors produced by the service.
type Future = Either<A::Future, B::Future>
The future response value.
fn poll_ready(&mut self) -> Poll<(), Self::Error>
[src]
fn poll_ready(&mut self) -> Poll<(), Self::Error>
Returns Ready
when the service is able to process requests. Read more
fn call(&mut self, req: Self::Request) -> Self::Future
[src]
fn call(&mut self, req: Self::Request) -> Self::Future
Process the request and return the response asynchronously. Read more
fn ready(self) -> Ready<Self>
[src]
fn ready(self) -> Ready<Self>
A future yielding the service when it is ready to accept a request.
Auto Trait Implementations
impl<A, B> Send for EitherService<A, B> where
A: Send,
B: Send,
impl<A, B> Send for EitherService<A, B> where
A: Send,
B: Send,
impl<A, B> Sync for EitherService<A, B> where
A: Sync,
B: Sync,
impl<A, B> Sync for EitherService<A, B> where
A: Sync,
B: Sync,