pub struct InvariantSet { /* private fields */ }Expand description
Batch invariant checker.
Collects multiple invariant results and reports the first failure. All invariants are checked even after a failure (useful for diagnostics).
Implementations§
Source§impl InvariantSet
impl InvariantSet
Sourcepub fn check_fn<F: FnOnce() -> bool>(&mut self, f: F, code: u32)
pub fn check_fn<F: FnOnce() -> bool>(&mut self, f: F, code: u32)
Add an invariant check with lazy evaluation.
Sourcepub fn checked_count(&self) -> u16
pub fn checked_count(&self) -> u16
Get the number of invariants checked.
Sourcepub fn passed_count(&self) -> u16
pub fn passed_count(&self) -> u16
Get the number of invariants that passed.
Sourcepub fn all_passed(&self) -> bool
pub fn all_passed(&self) -> bool
Did all invariants pass?
Sourcepub fn finalize(self) -> Result<(), ProgramError>
pub fn finalize(self) -> Result<(), ProgramError>
Finalize: return Ok if all passed, or the first failure code.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InvariantSet
impl RefUnwindSafe for InvariantSet
impl Send for InvariantSet
impl Sync for InvariantSet
impl Unpin for InvariantSet
impl UnsafeUnpin for InvariantSet
impl UnwindSafe for InvariantSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more