Trait cairo_vm::vm::runners::cairo_runner::ResourceTracker
source · pub trait ResourceTracker {
// Provided methods
fn consumed(&self) -> bool { ... }
fn consume_step(&mut self) { ... }
fn get_n_steps(&self) -> Option<usize> { ... }
fn run_resources(&self) -> &RunResources { ... }
}
Expand description
This trait is in charge of overseeing the VM’s step usage in contexts where a limited amount of steps are available for a single execution (which may or not involve other executions taking place in the duration of it ). This is mostly used in the context of starknet, where contracts can call other contracts while sharing the same step limit. For the general use case, the default implementation can be used, which ignores resource tracking altogether For an example on how to implement this trait for its intended purpose check out BuiltinHintProcessor
Provided Methods§
sourcefn consume_step(&mut self)
fn consume_step(&mut self)
Subtracts 1 step from the available steps
sourcefn get_n_steps(&self) -> Option<usize>
fn get_n_steps(&self) -> Option<usize>
Returns the available steps for the run
sourcefn run_resources(&self) -> &RunResources
fn run_resources(&self) -> &RunResources
Returns a reference to the available resources