pub trait Callback: Send {
// Provided methods
fn on_run_start(&mut self, _info: &RunInfo) { ... }
fn on_condition_start(
&mut self,
_index: usize,
_condition: &Condition,
) -> Action { ... }
fn on_batch_end(&mut self, _progress: &Progress<'_>) -> Action { ... }
fn on_condition_end(&mut self, _result: &ConditionResult) -> Action { ... }
fn on_run_end(&mut self, _results: &[ConditionResult]) { ... }
}Expand description
Hooks into a run (all optional).
Provided Methods§
Sourcefn on_run_start(&mut self, _info: &RunInfo)
fn on_run_start(&mut self, _info: &RunInfo)
Before the first condition.
Sourcefn on_condition_start(
&mut self,
_index: usize,
_condition: &Condition,
) -> Action
fn on_condition_start( &mut self, _index: usize, _condition: &Condition, ) -> Action
Before a condition: Action::Skip does not run it.
Sourcefn on_batch_end(&mut self, _progress: &Progress<'_>) -> Action
fn on_batch_end(&mut self, _progress: &Progress<'_>) -> Action
After every batch of trials: Action::StopCondition stops the condition.
Sourcefn on_condition_end(&mut self, _result: &ConditionResult) -> Action
fn on_condition_end(&mut self, _result: &ConditionResult) -> Action
After a condition (run or skipped): Action::StopRun ends the run.
Sourcefn on_run_end(&mut self, _results: &[ConditionResult])
fn on_run_end(&mut self, _results: &[ConditionResult])
After the last condition.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".