Standard Library
enum ContractKind
What kind of check a ContractViolation reports.
since 0.1.0-alpha.1linuxwindowswasm
Overview
The codes run from 0 (Precondition) to 3 (Invariant) in declaration order.
Examples
use io::console;
ContractKind k = ContractKind::Postcondition;
console.writeln(k == ContractKind::Postcondition);
console.writeln(k.toString());
true
Postcondition
Members
Assertion
Assertion = 2An assert statement failed.
Invariant
Invariant = 3A class or struct invariant failed at the object's boundary.
Postcondition
Postcondition = 1A post clause failed: the function broke its promise.
Precondition
Precondition = 0A pre clause failed: the caller broke the function's requirement.
See also
- ContractViolation — A violated contract: a failed
pre,post,assertorinvariant.