Skip to main content

ProgressSink

Trait ProgressSink 

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

Source

fn on_iteration(&mut self, report: &IterationReport)

Called once per iteration.

Provided Methods§

Source

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".

Implementors§