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§


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.

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

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



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