Skip to main content

Alt

Struct Alt 

Source
pub struct Alt<P> {
    pub pipelines: P,
}
Expand description

A wrapper for alternative pipeline execution.

Fields§

§pipelines: P

Trait Implementations§

Source§

impl<I, O, P1> Pipeline<I, Result<O, PipelineError>> for Alt<(P1,)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4, P5> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4, P5)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>, P5: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4, P5, P6> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4, P5, P6)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>, P5: Pipeline<I, PResult<O>>, P6: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4, P5, P6, P7> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4, P5, P6, P7)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>, P5: Pipeline<I, PResult<O>>, P6: Pipeline<I, PResult<O>>, P7: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4, P5, P6, P7, P8> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>, P5: Pipeline<I, PResult<O>>, P6: Pipeline<I, PResult<O>>, P7: Pipeline<I, PResult<O>>, P8: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Source§

impl<I, O, P1, P2, P3, P4, P5, P6, P7, P8, P9> Pipeline<I, Result<O, PipelineError>> for Alt<(P1, P2, P3, P4, P5, P6, P7, P8, P9)>
where I: Clone + Send + Sync + 'static, O: Send + 'static, P1: Pipeline<I, PResult<O>>, P2: Pipeline<I, PResult<O>>, P3: Pipeline<I, PResult<O>>, P4: Pipeline<I, PResult<O>>, P5: Pipeline<I, PResult<O>>, P6: Pipeline<I, PResult<O>>, P7: Pipeline<I, PResult<O>>, P8: Pipeline<I, PResult<O>>, P9: Pipeline<I, PResult<O>>,

Source§

fn apply(&self, ctx: Context<I>) -> impl Future<Output = PResult<O>> + Send

Auto Trait Implementations§

§

impl<P> Freeze for Alt<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for Alt<P>
where P: RefUnwindSafe,

§

impl<P> Send for Alt<P>
where P: Send,

§

impl<P> Sync for Alt<P>
where P: Sync,

§

impl<P> Unpin for Alt<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for Alt<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for Alt<P>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<P, I, O> Handler<I, O, ()> for P
where P: Pipeline<I, O>, I: Clone + Send + Sync + 'static, O: Send + 'static,

Source§

fn call(&self, ctx: Context<I>) -> impl Future<Output = O> + Send

Source§

impl<F, I, O, Args> HandlerExt<I, O, Args> for F
where F: Handler<I, O, Args>,

Source§

fn pipe(self) -> Pipe<Self, Args>
where Self: Sized,

Source§

fn connect<O2, G, Args2>( self, g: G, ) -> Connect<Pipe<Self, Args>, Pipe<G, Args2>, I, O, O2>
where G: Handler<O, O2, Args2>, Self: Sized,

Connects two pipelines together. Output of the first becomes the input of the second. Read more
Source§

fn pullback<I2, H, Args2>( self, handler: H, ) -> Pullback<Pipe<Self, Args>, Pipe<H, Args2>, I2, I, O>
where H: Handler<I2, I, Args2>, Self: Sized,

Pulls back the domain of the pipeline. This allows a pipeline defined on I to be used for input I2 given a mapping I2 -> I. The mapping function is now a full Handler (async, supports DI). Read more
Source§

fn lift<I2>( self, ) -> Pullback<Pipe<Self, Args>, Pipe<LiftHandler<I, I2>, (Input<I2>,)>, I2, I, O>
where I: From<I2> + Send + Sync + 'static, I2: Clone + Send + Sync + 'static, Self: Sized,

Lifts the domain requirement to anything that can be converted into the original input. Uses From / Into trait. Read more
Source§

fn extend<O2, F>(self, map: F) -> Extend<Pipe<Self, Args>, F, I, O, O2>
where F: Fn(O) -> O2 + Send + Sync + 'static, Self: Sized,

Extends the output of the pipeline by applying a transformation. Read more
Source§

fn repeat(self, times: usize) -> Repeat<Pipe<Self, Args>, I>
where Self: Handler<I, I, Args> + Sized, I: Clone + Send + Sync + 'static,

Repeats the pipeline operation n times. Input and output types must be the same. Read more
Source§

fn map(self) -> Map<Pipe<Self, Args>, I, O>
where Self: Sized,

Maps the pipeline over a collection of inputs concurrently. Input for the new pipeline will be Vec<I> and output will be Vec<O>. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.