OneInOneOut

Trait OneInOneOut 

Source
pub trait OneInOneOut<S, T, U>: Send + Sync
where S: State, T: Data + for<'a> Deserialize<'a>, U: Data + for<'a> Deserialize<'a>,
{ // Required methods fn on_data(&mut self, ctx: &mut OneInOneOutContext<'_, S, U>, data: &T); fn on_watermark(&mut self, ctx: &mut OneInOneOutContext<'_, S, U>); // Provided methods fn setup(&mut self, setup_context: &mut SetupContext<S>) { ... } fn run( &mut self, config: &OperatorConfig, read_stream: &mut ReadStream<T>, write_stream: &mut WriteStream<U>, ) { ... } fn destroy(&mut self) { ... } }
Expand description

The OneInOneOut trait must be implemented by operators that consume data from their input read stream, and generate output on an output write stream. The operator can either choose to consume data from its read_stream itself using the run method, or register for the on_data and on_watermark callbacks.

The callbacks registered in this operator execute sequentially by timestamp order and are allowed to mutate state in both the message and the watermark callbacks.

Required Methods§

Source

fn on_data(&mut self, ctx: &mut OneInOneOutContext<'_, S, U>, data: &T)

Source

fn on_watermark(&mut self, ctx: &mut OneInOneOutContext<'_, S, U>)

Provided Methods§

Source

fn setup(&mut self, setup_context: &mut SetupContext<S>)

Source

fn run( &mut self, config: &OperatorConfig, read_stream: &mut ReadStream<T>, write_stream: &mut WriteStream<U>, )

Source

fn destroy(&mut self)

Implementors§

Source§

impl<D> OneInOneOut<(), D, D> for FilterOperator<D>
where D: Data + for<'a> Deserialize<'a>,

Source§

impl<D, I> OneInOneOut<(), D, <I as IntoIterator>::Item> for FlatMapOperator<D, I>
where D: Data + for<'a> Deserialize<'a>, I: IntoIterator, I::Item: Data + for<'a> Deserialize<'a>,