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 const fn new() -> InvariantSet
pub const fn new() -> InvariantSet
Create a new empty invariant set.
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§
Source§impl Default for InvariantSet
impl Default for InvariantSet
Source§fn default() -> InvariantSet
fn default() -> InvariantSet
Returns the “default value” for a type. Read more
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