differential_equations/control.rs
1//! Control flow flags used by solvers, events, and output callbacks.
2
3use crate::traits::{CallBackData, Real, State};
4
5/// Directive to the solver indicating how to proceed with integration.
6///
7/// Returned by event functions and `Solout` callbacks to steer execution.
8///
9#[derive(Debug, Clone)]
10pub enum ControlFlag<T = f64, Y = f64, D = String>
11where
12 T: Real,
13 Y: State<T>,
14 D: CallBackData,
15{
16 /// Continue to the next step.
17 Continue,
18 /// Replace the current state and continue to the next step.
19 ModifyState(T, Y),
20 /// Terminate the solver with the given reason/data.
21 Terminate(D),
22}