differential_equations/
control.rs

1//! Control flow for solving process. Control flags and data return from events, solout functions, etc.
2
3use crate::traits::{CallBackData, Real, State};
4
5/// Control flag for solver execution flow
6///
7/// ControlFlag is a command to the solver about how to proceed with integration.
8/// Used by both event functions and solout functions to control solver execution.
9///
10#[derive(Debug, Clone)]
11pub enum ControlFlag<T = f64, V = f64, D = String>
12where
13    T: Real,
14    V: State<T>,
15    D: CallBackData,
16{
17    /// Continue to next step
18    Continue,
19    /// Modify State and continue to next step
20    ModifyState(T, V),
21    /// Terminate solver with the given reason/data
22    Terminate(D),
23}