pub trait ObservationSink: Send {
// Required method
fn on_observation(&mut self, observation: &Observation) -> ControlFlow;
// Provided method
fn on_complete(&mut self) { ... }
}Expand description
A callback that receives observations during execution.
Implement this trait to process observations in real-time. The default implementation collects into a Vec (batch mode).
Required Methods§
Sourcefn on_observation(&mut self, observation: &Observation) -> ControlFlow
fn on_observation(&mut self, observation: &Observation) -> ControlFlow
Called for each observation during execution.
Return ControlFlow::Continue to keep executing.
Return ControlFlow::Halt to stop immediately.
Provided Methods§
Sourcefn on_complete(&mut self)
fn on_complete(&mut self)
Called when execution completes (normally or via halt). Override to perform cleanup or final analysis.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".