Trait timely::dataflow::operators::core::inspect::InspectCore

source ·
pub trait InspectCore<G: Scope, C: Container> {
    // Required method
    fn inspect_container<F>(&self, func: F) -> StreamCore<G, C>
       where F: FnMut(Result<(&G::Timestamp, &C), &[G::Timestamp]>) + 'static;
}
Expand description

Inspect containers

Required Methods§

source

fn inspect_container<F>(&self, func: F) -> StreamCore<G, C>
where F: FnMut(Result<(&G::Timestamp, &C), &[G::Timestamp]>) + 'static,

Runs a supplied closure on each observed container, and each frontier advancement.

Rust’s Result type is used to distinguish the events, with Ok for time and data, and Err for frontiers. Frontiers are only presented when they change.

§Examples
use timely::dataflow::operators::{ToStream, Map, InspectCore};

timely::example(|scope| {
    (0..10).to_stream(scope)
           .inspect_container(|event| {
               match event {
                   Ok((time, data)) => println!("seen at: {:?}\t{:?} records", time, data.len()),
                   Err(frontier) => println!("frontier advanced to {:?}", frontier),
               }
            });
});

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<G: Scope, C: Container> InspectCore<G, C> for StreamCore<G, C>