Skip to main content

StopCondition

Trait StopCondition 

Source
pub trait StopCondition: Send + Sync {
    // Required method
    fn check(&self, snapshot: &RunSnapshot) -> Option<String>;
}
Expand description

A custom stop rule, checked with the built-in limits at the top of each turn. Return Some(reason) to end the run. Closures implement it.

Required Methods§

Source

fn check(&self, snapshot: &RunSnapshot) -> Option<String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> StopCondition for F
where F: Fn(&RunSnapshot) -> Option<String> + Send + Sync,