Skip to main content

Module wasm

Module wasm 

Source
Expand description

Re-export shim for the wasmtime primitives. Every consumer (Session, natives, future sshd integration) imports through this module so swapping the underlying implementation never touches more than one path.

The implementation lives in scripting::runtime so the entity-script ScriptExecutor and the rpc eval channel share one engine builder, one ModuleCache, and one trap-classification helper. See ADR 0011 in the plan for the dedup rationale.

Structs§

EngineOpts
ModuleCache
Per-engine bytecode cache keyed by the full module bytes. Cloning a ModuleCache yields a handle into the same inner map; meant to be shared between long-lived hosts (Session, ScriptExecutor) and any per-form helpers that need the same cached compilation.

Enums§

EngineError

Functions§

build_engine
call_i64_export
Instantiates module against an empty linker and calls a zero-arg export returning a single i64. Constraints (fuel cap, epoch deadline) come from the caller-supplied Store.
classify_runtime_error
Classifies a [wasmtime::Error] thrown during execution into a typed EngineError. Downcast to [wasmtime::Trap] handles the structured fuel/epoch cases; everything else falls through as Trap(message).
compile_module
compile_wat