pub trait ProgressSink {
// Required method
fn on_iteration(&mut self, report: &IterationReport);
// Provided method
fn should_cancel(&self) -> bool { ... }
}Expand description
Something that watches an optimisation and can stop it.
Required Methods§
Sourcefn on_iteration(&mut self, report: &IterationReport)
fn on_iteration(&mut self, report: &IterationReport)
Called once per iteration.
Provided Methods§
Sourcefn should_cancel(&self) -> bool
fn should_cancel(&self) -> bool
Asked after every report. Returning true ends the run with Exit::Cancelled, keeping the best point.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".