pub struct Budget { /* private fields */ }Expand description
Tracks consumption against Limits and remembers the first breach.
Implementations§
Source§impl Budget
impl Budget
Sourcepub fn limit_hit(&self) -> Option<ErrorCode>
pub fn limit_hit(&self) -> Option<ErrorCode>
The first limit that stopped the run, if any (--trace-limits).
Sourcepub fn add_states(&mut self, n: u64) -> Result<(), ErrorCode>
pub fn add_states(&mut self, n: u64) -> Result<(), ErrorCode>
Account for n new states. Overflow counts as a breach.
Sourcepub fn add_memory(&mut self, bytes: u64) -> Result<(), ErrorCode>
pub fn add_memory(&mut self, bytes: u64) -> Result<(), ErrorCode>
Account for bytes of estimated memory.
Sourcepub fn check_time(&mut self) -> Result<(), ErrorCode>
pub fn check_time(&mut self) -> Result<(), ErrorCode>
Cooperative time check; call at loop boundaries.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Budget
impl Freeze for Budget
impl RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnsafeUnpin for Budget
impl UnwindSafe for Budget
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