Skip to main content

Sink

Struct Sink 

Source
pub struct Sink<H> { /* private fields */ }
Expand description

A pipeline aggregator that distributes input to multiple handlers and collects their outputs.

Implementations§

Source§

impl<H> Sink<H>

Source

pub fn concurrent(self) -> Self

Enable concurrent execution of the handlers using futures::join!.

Source

pub fn sequential(self) -> Self

Enable sequential execution of the handlers (default).

Trait Implementations§

Source§

impl<I, H1, O1, A1> Handler<I, (O1,), (A1,)> for Sink<(H1,)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static,

Source§

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

Source§

impl<I, H1, O1, A1, H2, O2, A2> Handler<I, (O1, O2), (A1, A2)> for Sink<(H1, H2)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static,

Source§

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

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3> Handler<I, (O1, O2, O3), (A1, A2, A3)> for Sink<(H1, H2, H3)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static,

Source§

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

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4> Handler<I, (O1, O2, O3, O4), (A1, A2, A3, A4)> for Sink<(H1, H2, H3, H4)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static,

Source§

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

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5> Handler<I, (O1, O2, O3, O4, O5), (A1, A2, A3, A4, A5)> for Sink<(H1, H2, H3, H4, H5)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static,

Source§

fn call( &self, ctx: Context<I>, ) -> impl Future<Output = (O1, O2, O3, O4, O5)> + Send

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5, H6, O6, A6> Handler<I, (O1, O2, O3, O4, O5, O6), (A1, A2, A3, A4, A5, A6)> for Sink<(H1, H2, H3, H4, H5, H6)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static, O6: Send + 'static, H6: Handler<I, O6, A6>, A6: Send + Sync + 'static,

Source§

fn call( &self, ctx: Context<I>, ) -> impl Future<Output = (O1, O2, O3, O4, O5, O6)> + Send

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5, H6, O6, A6, H7, O7, A7> Handler<I, (O1, O2, O3, O4, O5, O6, O7), (A1, A2, A3, A4, A5, A6, A7)> for Sink<(H1, H2, H3, H4, H5, H6, H7)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static, O6: Send + 'static, H6: Handler<I, O6, A6>, A6: Send + Sync + 'static, O7: Send + 'static, H7: Handler<I, O7, A7>, A7: Send + Sync + 'static,

Source§

fn call( &self, ctx: Context<I>, ) -> impl Future<Output = (O1, O2, O3, O4, O5, O6, O7)> + Send

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5, H6, O6, A6, H7, O7, A7, H8, O8, A8> Handler<I, (O1, O2, O3, O4, O5, O6, O7, O8), (A1, A2, A3, A4, A5, A6, A7, A8)> for Sink<(H1, H2, H3, H4, H5, H6, H7, H8)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static, O6: Send + 'static, H6: Handler<I, O6, A6>, A6: Send + Sync + 'static, O7: Send + 'static, H7: Handler<I, O7, A7>, A7: Send + Sync + 'static, O8: Send + 'static, H8: Handler<I, O8, A8>, A8: Send + Sync + 'static,

Source§

fn call( &self, ctx: Context<I>, ) -> impl Future<Output = (O1, O2, O3, O4, O5, O6, O7, O8)> + Send

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5, H6, O6, A6, H7, O7, A7, H8, O8, A8, H9, O9, A9> Handler<I, (O1, O2, O3, O4, O5, O6, O7, O8, O9), (A1, A2, A3, A4, A5, A6, A7, A8, A9)> for Sink<(H1, H2, H3, H4, H5, H6, H7, H8, H9)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static, O6: Send + 'static, H6: Handler<I, O6, A6>, A6: Send + Sync + 'static, O7: Send + 'static, H7: Handler<I, O7, A7>, A7: Send + Sync + 'static, O8: Send + 'static, H8: Handler<I, O8, A8>, A8: Send + Sync + 'static, O9: Send + 'static, H9: Handler<I, O9, A9>, A9: Send + Sync + 'static,

Source§

fn call( &self, ctx: Context<I>, ) -> impl Future<Output = (O1, O2, O3, O4, O5, O6, O7, O8, O9)> + Send

Source§

impl<I, H1, O1, A1, H2, O2, A2, H3, O3, A3, H4, O4, A4, H5, O5, A5, H6, O6, A6, H7, O7, A7, H8, O8, A8, H9, O9, A9, H10, O10, A10> Handler<I, (O1, O2, O3, O4, O5, O6, O7, O8, O9, O10), (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> for Sink<(H1, H2, H3, H4, H5, H6, H7, H8, H9, H10)>
where I: Clone + Send + Sync + 'static, O1: Send + 'static, H1: Handler<I, O1, A1>, A1: Send + Sync + 'static, O2: Send + 'static, H2: Handler<I, O2, A2>, A2: Send + Sync + 'static, O3: Send + 'static, H3: Handler<I, O3, A3>, A3: Send + Sync + 'static, O4: Send + 'static, H4: Handler<I, O4, A4>, A4: Send + Sync + 'static, O5: Send + 'static, H5: Handler<I, O5, A5>, A5: Send + Sync + 'static, O6: Send + 'static, H6: Handler<I, O6, A6>, A6: Send + Sync + 'static, O7: Send + 'static, H7: Handler<I, O7, A7>, A7: Send + Sync + 'static, O8: Send + 'static, H8: Handler<I, O8, A8>, A8: Send + Sync + 'static, O9: Send + 'static, H9: Handler<I, O9, A9>, A9: Send + Sync + 'static, O10: Send + 'static, H10: Handler<I, O10, A10>, A10: Send + Sync + 'static,

Auto Trait Implementations§

§

impl<H> Freeze for Sink<H>
where H: Freeze,

§

impl<H> RefUnwindSafe for Sink<H>
where H: RefUnwindSafe,

§

impl<H> Send for Sink<H>
where H: Send,

§

impl<H> Sync for Sink<H>
where H: Sync,

§

impl<H> Unpin for Sink<H>
where H: Unpin,

§

impl<H> UnwindSafe for Sink<H>
where H: 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<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§

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.