Struct miden_air::ExecutionOptions
source · pub struct ExecutionOptions { /* private fields */ }
Expand description
A set of parameters specifying execution parameters of the VM.
max_cycles
specifies the maximum number of cycles a program is allowed to execute.expected_cycles
specifies 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
) -> Result<Self, ExecutionOptionsError>
pub fn new( max_cycles: Option<u32>, expected_cycles: u32, enable_tracing: bool ) -> Result<Self, 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) -> Self
pub fn with_tracing(self) -> Self
Enables execution of the trace
instructions.
sourcepub fn with_debugging(self) -> Self
pub fn with_debugging(self) -> Self
Enables execution of programs in debug mode.
In debug mode the VM does the following:
- Executes
debug
instructions (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 moresource§impl Debug for ExecutionOptions
impl Debug for ExecutionOptions
source§impl Default for ExecutionOptions
impl Default for ExecutionOptions
source§impl PartialEq for ExecutionOptions
impl PartialEq for ExecutionOptions
source§fn eq(&self, other: &ExecutionOptions) -> bool
fn eq(&self, other: &ExecutionOptions) -> bool
self
and other
values to be equal, and is used
by ==
.