Skip to main content

Invariant

Trait Invariant 

Source
pub trait Invariant: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn class(&self) -> InvariantClass;
    fn check(&self, ctx: &dyn Context) -> InvariantResult;
}
Expand description

A runtime invariant that the engine enforces.

Invariants are the “law” that Gherkin specs compile to.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name for tracing and error messages.

Source

fn class(&self) -> InvariantClass

The class determines when this invariant is checked.

Source

fn check(&self, ctx: &dyn Context) -> InvariantResult

Check the invariant against the current context.

Implementors§