Skip to main content

ObservationSink

Trait ObservationSink 

Source
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§

Source

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§

Source

fn on_complete(&mut self)

Called when execution completes (normally or via halt). Override to perform cleanup or final analysis.

Implementors§