pub trait AsyncOperator<I> {
    type Output;
    type Error;
    type Future<'a>: Future<Output = Result<Self::Output, Self::Error>>
       where Self: 'a;

    // Required methods
    fn poll_ready(
        &mut self,
        cx: &mut Context<'_>
    ) -> Poll<Result<(), Self::Error>>;
    fn next(&mut self, input: I) -> Self::Future<'_>;
}
Expand description

Async Operator. It can be seen as an alias of tower_service::Service.

Required Associated Types§

source

type Output

Output type.

source

type Error

Error type.

source

type Future<'a>: Future<Output = Result<Self::Output, Self::Error>> where Self: 'a

The future output value.

Required Methods§

source

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>

Check if the operator is ready to process the next input.

source

fn next(&mut self, input: I) -> Self::Future<'_>

Process the next input.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<I, E, F, P> AsyncOperator<I> for MapErr<F, P>where P: AsyncOperator<I>, F: FnMut(P::Error) -> E,

§

type Output = <P as AsyncOperator<I>>::Output

§

type Error = E

§

type Future<'a> = MapErr<<P as AsyncOperator<I>>::Future<'a>, &'a mut F> where P: 'a, F: 'a

source§

impl<I, E, P1, P2> AsyncOperator<I> for Then<I, P1, P2>where P1: AsyncOperator<I, Error = E>, P2: AsyncOperator<P1::Output, Error = E>,

§

type Output = <P2 as AsyncOperator<<P1 as AsyncOperator<I>>::Output>>::Output

§

type Error = E

§

type Future<'a> = AndThenFuture<'a, <P1 as AsyncOperator<I>>::Future<'a>, P2> where I: 'a, P1: 'a, P2: 'a

source§

impl<P, I, O> AsyncOperator<I> for Next<P>where P: Operator<I, Output = O>,

§

type Output = O

§

type Error = Infallible

§

type Future<'a> = Ready<Result<<Next<P> as AsyncOperator<I>>::Output, <Next<P> as AsyncOperator<I>>::Error>> where P: 'a

source§

impl<S, I, O> AsyncOperator<I> for ServiceOp<S>where S: Service<I, Response = O>,

§

type Output = O

§

type Error = <S as Service<I>>::Error

§

type Future<'a> = <S as Service<I>>::Future where S: 'a