Skip to main content

TunableStage

Trait TunableStage 

Source
pub trait TunableStage {
    // Required method
    fn search(
        &self,
        settings: &BalanceSettings,
        evaluate: &mut Evaluate<'_>,
        should_stop: &mut dyn FnMut() -> bool,
        apply: bool,
    ) -> Result<Searched, String>;
}
Expand description

A Tunable of any stage type, as autobalance runs it.

Required Methods§

Source

fn search( &self, settings: &BalanceSettings, evaluate: &mut Evaluate<'_>, should_stop: &mut dyn FnMut() -> bool, apply: bool, ) -> Result<Searched, String>

The search over the stage (shuyi_core::autobalance_by) as settings say, each setting played by evaluate, asking should_stop before each run; with apply, the stage found is written if it changed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§