Skip to main content

ProgramExecutor

Trait ProgramExecutor 

Source
pub trait ProgramExecutor {
    // Required methods
    fn new(
        stack_inputs: StackInputs,
        advice_inputs: AdviceInputs,
        options: ExecutionOptions,
    ) -> Self
       where Self: Sized;
    fn execute<H: Host + Send>(
        self,
        program: &Program,
        host: &mut H,
    ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>;

    // Provided method
    fn execute_with_package_debug_info<H: Host + Send>(
        self,
        program: &Program,
        package_debug_info: &PackageDebugInfo,
        entrypoint_source_node: Option<DebugSourceNodeId>,
        host: &mut H,
    ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>
       where Self: Sized { ... }
}
Expand description

A transaction-scoped program executor used by TransactionExecutor.

TODO: Move this trait into miden-vm once the executor boundary is consolidated there.

Required Methods§

Source

fn new( stack_inputs: StackInputs, advice_inputs: AdviceInputs, options: ExecutionOptions, ) -> Self
where Self: Sized,

Create a new executor configured with the provided transaction inputs and options.

Source

fn execute<H: Host + Send>( self, program: &Program, host: &mut H, ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>

Execute the provided program against the given host.

Provided Methods§

Source

fn execute_with_package_debug_info<H: Host + Send>( self, program: &Program, package_debug_info: &PackageDebugInfo, entrypoint_source_node: Option<DebugSourceNodeId>, host: &mut H, ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>
where Self: Sized,

Execute the provided program with package-owned source/debug context.

Executors that do not support package debug execution may fall back to plain execution.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ProgramExecutor for FastProcessor

Source§

fn new( stack_inputs: StackInputs, advice_inputs: AdviceInputs, options: ExecutionOptions, ) -> Self

Source§

fn execute<H: Host + Send>( self, program: &Program, host: &mut H, ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>

Source§

fn execute_with_package_debug_info<H: Host + Send>( self, program: &Program, package_debug_info: &PackageDebugInfo, entrypoint_source_node: Option<DebugSourceNodeId>, host: &mut H, ) -> impl FutureMaybeSend<Result<ExecutionOutput, ExecutionError>>

Implementors§