google / libtracecmd-rs

Rust wrapper of libtracecmd

Home Page:https://crates.io/crates/libtracecmd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support iterator over Record

keiichiw opened this issue · comments

To iterate over Records in a given Input, the current supported way is implementing the Handler and call Handler::process, which is a wrapper of tracecmd_iterate_events().

To support more flexible handling, it'd be nice to support Iterator whose Item is Record.

let input = Input::new(...)?;
for event in input.to_iter() {
  // process event
}

Its next() should be able to be implemented by wrapping tracecmd_read_data.