pub struct ExecutionOptions { /* private fields */ }Expand description
A set of parameters specifying execution parameters of the VM.
max_cyclesspecifies the maximum number of cycles a program is allowed to execute.expected_cyclesspecifies the number of cycles a program is expected to execute.
Implementations§
Source§impl ExecutionOptions
impl ExecutionOptions
Sourcepub fn new(
max_cycles: Option<u32>,
expected_cycles: u32,
enable_tracing: bool,
enable_debugging: bool,
) -> Result<ExecutionOptions, ExecutionOptionsError>
pub fn new( max_cycles: Option<u32>, expected_cycles: u32, enable_tracing: bool, enable_debugging: bool, ) -> Result<ExecutionOptions, ExecutionOptionsError>
Creates a new instance of ExecutionOptions from the specified parameters.
If the max_cycles is None the maximum number of cycles will be set to u32::MAX
Sourcepub fn with_tracing(self) -> ExecutionOptions
pub fn with_tracing(self) -> ExecutionOptions
Enables execution of the trace instructions.
Sourcepub fn with_debugging(self) -> ExecutionOptions
pub fn with_debugging(self) -> ExecutionOptions
Enables execution of programs in debug mode.
In debug mode the VM does the following:
- Executes
debuginstructions (these are ignored in regular mode). - Records additional info about program execution (e.g., keeps track of stack state at every cycle of the VM) which enables stepping through the program forward and backward.
Sourcepub fn max_cycles(&self) -> u32
pub fn max_cycles(&self) -> u32
Returns maximum number of cycles a program is allowed to execute for.
Sourcepub fn expected_cycles(&self) -> u32
pub fn expected_cycles(&self) -> u32
Returns the number of cycles a program is expected to take.
This will serve as a hint to the VM for how much memory to allocate for a program’s execution trace and may result in performance improvements when the number of expected cycles is equal to the number of actual cycles.
Sourcepub fn enable_tracing(&self) -> bool
pub fn enable_tracing(&self) -> bool
Returns a flag indicating whether the VM should execute trace instructions.
Sourcepub fn enable_debugging(&self) -> bool
pub fn enable_debugging(&self) -> bool
Returns a flag indicating whether the VM should execute a program in debug mode.
Trait Implementations§
Source§impl Clone for ExecutionOptions
impl Clone for ExecutionOptions
Source§fn clone(&self) -> ExecutionOptions
fn clone(&self) -> ExecutionOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more