pub struct InputHandleCore<T: Timestamp, D: Container, P: Pull<BundleCore<T, D>>> { /* private fields */ }
Expand description
Handle to an operator’s input stream.
Implementations§
source§impl<'a, T: Timestamp, D: Container, P: Pull<BundleCore<T, D>>> InputHandleCore<T, D, P>
impl<'a, T: Timestamp, D: Container, P: Pull<BundleCore<T, D>>> InputHandleCore<T, D, P>
sourcepub fn next(&mut self) -> Option<(InputCapability<T>, RefOrMut<'_, D>)>
pub fn next(&mut self) -> Option<(InputCapability<T>, RefOrMut<'_, D>)>
Reads the next input buffer (at some timestamp t
) and a corresponding capability for t
.
The timestamp t
of the input buffer can be retrieved by invoking .time()
on the capability.
Returns None
when there’s no more data available.
sourcepub fn for_each<F: FnMut(InputCapability<T>, RefOrMut<'_, D>)>(
&mut self,
logic: F
)
pub fn for_each<F: FnMut(InputCapability<T>, RefOrMut<'_, D>)>( &mut self, logic: F )
Repeatedly calls logic
till exhaustion of the available input data.
logic
receives a capability and an input buffer.
Examples
use timely::dataflow::operators::ToStream;
use timely::dataflow::operators::generic::Operator;
use timely::dataflow::channels::pact::Pipeline;
timely::example(|scope| {
(0..10).to_stream(scope)
.unary(Pipeline, "example", |_cap, _info| |input, output| {
input.for_each(|cap, data| {
output.session(&cap).give_vec(&mut data.replace(Vec::new()));
});
});
});
Auto Trait Implementations§
impl<T, D, P> !RefUnwindSafe for InputHandleCore<T, D, P>
impl<T, D, P> !Send for InputHandleCore<T, D, P>
impl<T, D, P> !Sync for InputHandleCore<T, D, P>
impl<T, D, P> Unpin for InputHandleCore<T, D, P>where D: Unpin, P: Unpin,
impl<T, D, P> !UnwindSafe for InputHandleCore<T, D, P>
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