Skip to main content

AlgorithmObserver

Trait AlgorithmObserver 

Source
pub trait AlgorithmObserver<T, Q = f64>: Send + 'static
where T: Clone + Send + 'static, Q: Clone + Send + 'static,
{ // Required methods fn update(&mut self, event: &AlgorithmEvent<T, Q>); fn name(&self) -> &str; // Provided method fn finalize(&mut self) { ... } }
Expand description

Trait for observing algorithm execution.

Observers receive lifecycle and progress events emitted by the runtime. Typical use cases include console output, report generation, metrics export, and external integrations.

Required Methods§

Source

fn update(&mut self, event: &AlgorithmEvent<T, Q>)

Called when an event occurs during algorithm execution

Source

fn name(&self) -> &str

Returns the name of this observer

Provided Methods§

Source

fn finalize(&mut self)

Called at the end of the algorithm to finalize any resources

Implementors§

Source§

impl<T, Q> AlgorithmObserver<T, Q> for ChartObserver
where T: Clone + Send + 'static, Q: Clone + Send + 'static,

Source§

impl<T, Q> AlgorithmObserver<T, Q> for ConsoleObserver
where T: Clone + Send + 'static, Q: Clone + Send + 'static,

Source§

impl<T, Q> AlgorithmObserver<T, Q> for HtmlReportObserver
where T: Clone + Send + Debug + 'static, Q: Clone + Send + 'static,