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§
Sourcefn class(&self) -> InvariantClass
fn class(&self) -> InvariantClass
The class determines when this invariant is checked.
Sourcefn check(&self, ctx: &dyn Context) -> InvariantResult
fn check(&self, ctx: &dyn Context) -> InvariantResult
Check the invariant against the current context.