Skip to main content

run_linked_program

Function run_linked_program 

Source
pub fn run_linked_program<H: Host>(
    program: &Program<Verified>,
    entries: &dyn NativeEntryTable,
    host: &mut H,
    limits: &Limits,
) -> Result<ExecutionOutcome, NativeError>
Expand description

Runs a linked program’s entry through the native engine and returns its observable outcome. This is the runtime side of the AOT main: entries is a compiled NativeEntryTable (an AOT LinkedProgram or a JIT program), and the returned ExecutionOutcome carries buffered stdout and the exit code. It is always available and never feature-gated, so a downstream host crate can link against it without enabling the runtime’s aot-main feature.

Returns NativeError::ProgramMismatch before constructing the engine when entries was not compiled from this program’s exact canonical encoding.