pub struct FlatMapOperator<D, I>{ /* private fields */ }
Expand description
Maps an incoming stream of type D to a stream of type I::Item
using the provided
function.
§Example
The below example shows how to use a FlatMapOperator
to double an incoming stream of usize
messages, and return them.
let map_stream = erdos::connect_one_in_one_out(
|| -> FlatMapOperator<usize, _> {
FlatMapOperator::new(|x: &usize| -> Vec<usize> { vec![2 * x] })
},
|| {},
OperatorConfig::new().name("FlatMapOperator"),
&source_stream,
);
Implementations§
Source§impl<D, I> FlatMapOperator<D, I>
impl<D, I> FlatMapOperator<D, I>
Trait Implementations§
Source§impl<D, I> OneInOneOut<(), D, <I as IntoIterator>::Item> for FlatMapOperator<D, I>
impl<D, I> OneInOneOut<(), D, <I as IntoIterator>::Item> for FlatMapOperator<D, I>
fn on_data(&mut self, ctx: &mut OneInOneOutContext<'_, (), I::Item>, data: &D)
fn on_watermark(&mut self, _ctx: &mut OneInOneOutContext<'_, (), I::Item>)
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)
Auto Trait Implementations§
impl<D, I> Freeze for FlatMapOperator<D, I>
impl<D, I> !RefUnwindSafe for FlatMapOperator<D, I>
impl<D, I> Send for FlatMapOperator<D, I>
impl<D, I> Sync for FlatMapOperator<D, I>
impl<D, I> Unpin for FlatMapOperator<D, I>
impl<D, I> !UnwindSafe for FlatMapOperator<D, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more