pub trait Invariant: 'static {
// Required methods
fn name(&self) -> &str;
fn check(&self, state: &StateHandle, sim_time_ms: u64);
}Expand description
An invariant that validates system-wide properties during simulation.
Invariants are checked after every simulation event. They should panic with a descriptive message if the invariant is violated.
Required Methods§
Sourcefn check(&self, state: &StateHandle, sim_time_ms: u64)
fn check(&self, state: &StateHandle, sim_time_ms: u64)
Check the invariant against current state and simulation time.
Should panic with a descriptive message if the invariant is violated.