Skip to main content

Invariant

Trait Invariant 

Source
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§

Source

fn name(&self) -> &str

Name of this invariant for reporting.

Source

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.

Implementations on Foreign Types§

Source§

impl Invariant for MessageInvariantChecker

Source§

fn name(&self) -> &str

Source§

fn check(&self, state: &StateHandle, _sim_time_ms: u64)

Source§

impl Invariant for RpcInvariantChecker

Source§

fn name(&self) -> &str

Source§

fn check(&self, state: &StateHandle, _sim_time_ms: u64)

Implementors§