Skip to main content

StateMachine

Trait StateMachine 

Source
pub trait StateMachine {
    // Required methods
    fn rules(&self) -> Vec<Rule<Self>>;
    fn invariants(&self) -> Vec<Rule<Self>>;
}
Expand description

Trait for defining a stateful test.

Implement this to define the rules (actions) and invariants (assertions) of your state machine. Use #[hegel::state_machine] for a more ergonomic way to define state machines.

Required Methods§

Source

fn rules(&self) -> Vec<Rule<Self>>

The rules (actions) that can be applied to this state machine.

Source

fn invariants(&self) -> Vec<Rule<Self>>

Invariants checked after each successful rule application.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§