Struct miden_processor::ExecutionOptions
source · 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,
) -> Result<ExecutionOptions, ExecutionOptionsError>
pub fn new( max_cycles: Option<u32>, expected_cycles: u32, enable_tracing: 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 moresource§impl Debug for ExecutionOptions
impl Debug for ExecutionOptions
source§impl Default for ExecutionOptions
impl Default for ExecutionOptions
source§fn default() -> ExecutionOptions
fn default() -> ExecutionOptions
source§impl PartialEq for ExecutionOptions
impl PartialEq for ExecutionOptions
impl Copy for ExecutionOptions
impl Eq for ExecutionOptions
impl StructuralPartialEq for ExecutionOptions
Auto Trait Implementations§
impl Freeze for ExecutionOptions
impl RefUnwindSafe for ExecutionOptions
impl Send for ExecutionOptions
impl Sync for ExecutionOptions
impl Unpin for ExecutionOptions
impl UnwindSafe for ExecutionOptions
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)