pub trait EngineObserver: Send + Sync {
// Required method
fn on_event(&self, event: EngineEvent);
}Expand description
Trait for receiving engine progress events.
Implementations must be Send + Sync since events may be emitted from
worker threads. The engine holds a shared reference to the observer and
calls on_event synchronously on the thread that
produced the event.
§Example usage
- progress_events_match_tile_count
uses a
CollectingObserver(which implements this trait) to capture and inspect all events emitted during a test pyramid build. - CLI source implements this trait to print live progress to stderr.