pub trait LoopVariable<'scope, TOuter: Timestamp, TInner: Timestamp> {
// Required method
fn loop_variable<C: Container>(
&self,
summary: TInner::Summary,
) -> (Handle<'scope, Product<TOuter, TInner>, C>, Stream<'scope, Product<TOuter, TInner>, C>);
}Expand description
Creates a Stream and a Handle to later bind the source of that Stream.
Required Methods§
Sourcefn loop_variable<C: Container>(
&self,
summary: TInner::Summary,
) -> (Handle<'scope, Product<TOuter, TInner>, C>, Stream<'scope, Product<TOuter, TInner>, C>)
fn loop_variable<C: Container>( &self, summary: TInner::Summary, ) -> (Handle<'scope, Product<TOuter, TInner>, C>, Stream<'scope, Product<TOuter, TInner>, C>)
Creates a Stream and a Handle to later bind the source of that Stream.
The resulting Stream will have its data defined by a future call to connect_loop with
its Handle passed as an argument. Messages passed through the stream will have the
elements of their stamps advanced by summary. Container contents are not inspected or
changed; containers whose contents carry times must advance them before the loop.
A message is dropped if its advanced stamp is empty, which includes messages that arrive with empty stamps.
§Examples
use timely::dataflow::Scope;
use timely::dataflow::operators::{LoopVariable, ConnectLoop, ToStream, Concat, Inspect};
use timely::dataflow::operators::vec::{Map, Filter};
timely::example(|scope| {
// circulate 0..10, incrementing each, until each reaches 100.
scope.iterative::<usize,_,_>(|inner| {
let (handle, cycle) = inner.loop_variable(1);
(0..10).to_stream(inner)
.container::<Vec<_>>()
.concat(cycle)
.inspect(|x| println!("seen: {:?}", x))
.map(|x| x + 1)
.filter(|x| *x < 100)
.connect_loop(handle);
});
});Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".