Function check

Source
pub fn check<F, M>(pred: F, message: M) -> Result<()>
where F: FnOnce() -> bool, M: Display,
Expand description

Verifies than an arbitrary condition is met, intended to verify preservation of an invariant at runtime. Think of this as a requires designed to be used anywhere in control flow.