pub struct ExecutionCounters {
pub commands: usize,
pub function_depth: usize,
pub loop_iterations: usize,
}Expand description
Execution counters for tracking resource usage
Fields§
§commands: usizeNumber of commands executed
function_depth: usizeCurrent function call depth
loop_iterations: usizeNumber of iterations in current loop
Implementations§
Source§impl ExecutionCounters
impl ExecutionCounters
Sourcepub fn tick_command(
&mut self,
limits: &ExecutionLimits,
) -> Result<(), LimitExceeded>
pub fn tick_command( &mut self, limits: &ExecutionLimits, ) -> Result<(), LimitExceeded>
Increment command counter, returns error if limit exceeded
Sourcepub fn tick_loop(
&mut self,
limits: &ExecutionLimits,
) -> Result<(), LimitExceeded>
pub fn tick_loop( &mut self, limits: &ExecutionLimits, ) -> Result<(), LimitExceeded>
Increment loop iteration counter, returns error if limit exceeded
Sourcepub fn reset_loop(&mut self)
pub fn reset_loop(&mut self)
Reset loop iteration counter (called when entering a new loop)
Sourcepub fn push_function(
&mut self,
limits: &ExecutionLimits,
) -> Result<(), LimitExceeded>
pub fn push_function( &mut self, limits: &ExecutionLimits, ) -> Result<(), LimitExceeded>
Push function call, returns error if depth exceeded
Sourcepub fn pop_function(&mut self)
pub fn pop_function(&mut self)
Pop function call
Trait Implementations§
Source§impl Clone for ExecutionCounters
impl Clone for ExecutionCounters
Source§fn clone(&self) -> ExecutionCounters
fn clone(&self) -> ExecutionCounters
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutionCounters
impl Debug for ExecutionCounters
Source§impl Default for ExecutionCounters
impl Default for ExecutionCounters
Source§fn default() -> ExecutionCounters
fn default() -> ExecutionCounters
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecutionCounters
impl RefUnwindSafe for ExecutionCounters
impl Send for ExecutionCounters
impl Sync for ExecutionCounters
impl Unpin for ExecutionCounters
impl UnwindSafe for ExecutionCounters
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