Skip to main content

FitObserver

Trait FitObserver 

Source
pub trait FitObserver<E: Equation + Send + 'static> {
    // Required method
    fn on_cycle(&mut self, controller: &FitController<E>) -> CycleFlow;
}
Expand description

A callback run after every cycle of a fit.

It receives the live FitController to read the current state, and returns a CycleFlow to keep going or bail out. Any FnMut(&FitController<E>) -> CycleFlow works, so you can hand a plain closure to fit_with_observer.

Required Methods§

Source

fn on_cycle(&mut self, controller: &FitController<E>) -> CycleFlow

Implementors§

Source§

impl<E, F> FitObserver<E> for F
where E: Equation + Send + 'static, F: FnMut(&FitController<E>) -> CycleFlow,