Struct miden_processor::Process
source · pub struct Process<H>where
H: Host,{ /* private fields */ }Expand description
A Process is the underlying execution engine for a Miden Program.
Typically, you do not need to worry about, or use Process directly, instead you should prefer to use either execute or execute_iter, which also handle setting up the process state, inputs, as well as compute the ExecutionTrace for the program.
However, for situations in which you want finer-grained control over those steps, you will need to construct an instance of Process using Process::new, invoke Process::execute, and then get the execution trace using ExecutionTrace::new using the outputs produced by execution.
Implementations§
source§impl<H> Process<H>where
H: Host,
impl<H> Process<H>where
H: Host,
sourcepub fn new(
kernel: Kernel,
stack_inputs: StackInputs,
host: H,
execution_options: ExecutionOptions,
) -> Self
pub fn new( kernel: Kernel, stack_inputs: StackInputs, host: H, execution_options: ExecutionOptions, ) -> Self
Creates a new process with the provided inputs.
sourcepub fn new_debug(kernel: Kernel, stack_inputs: StackInputs, host: H) -> Self
pub fn new_debug(kernel: Kernel, stack_inputs: StackInputs, host: H) -> Self
Creates a new process with provided inputs and debug options enabled.
sourcepub fn execute(
&mut self,
program: &Program,
) -> Result<StackOutputs, ExecutionError>
pub fn execute( &mut self, program: &Program, ) -> Result<StackOutputs, ExecutionError>
Executes the provided Program in this process.
pub const fn kernel(&self) -> &Kernel
pub fn into_parts(self) -> (System, Decoder, Stack, RangeChecker, Chiplets, H)
Trait Implementations§
source§impl<H: Host> ProcessState for Process<H>
impl<H: Host> ProcessState for Process<H>
source§fn get_stack_item(&self, pos: usize) -> Felt
fn get_stack_item(&self, pos: usize) -> Felt
Returns the value located at the specified position on the stack at the current clock cycle.
source§fn get_stack_word(&self, word_idx: usize) -> Word
fn get_stack_word(&self, word_idx: usize) -> Word
Returns a word located at the specified word index on the stack. Read more
source§fn get_stack_state(&self) -> Vec<Felt>
fn get_stack_state(&self) -> Vec<Felt>
Returns stack state at the current clock cycle. This includes the top 16 items of the
stack + overflow entries.
Auto Trait Implementations§
impl<H> !Freeze for Process<H>
impl<H> !RefUnwindSafe for Process<H>
impl<H> Send for Process<H>where
H: Send,
impl<H> !Sync for Process<H>
impl<H> Unpin for Process<H>where
H: Unpin,
impl<H> UnwindSafe for Process<H>where
H: UnwindSafe,
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