pub struct Config { /* private fields */ }Expand description
Global configuration for an crate::Engine. Builder methods return &mut Self.
Implementations§
Source§impl Config
impl Config
Sourcepub fn consume_fuel(&mut self, enable: bool) -> &mut Self
pub fn consume_fuel(&mut self, enable: bool) -> &mut Self
Enables fuel consumption (metering). Off by default.
Sourcepub fn epoch_interruption(&mut self, enable: bool) -> &mut Self
pub fn epoch_interruption(&mut self, enable: bool) -> &mut Self
Enables epoch-based interruption. Off by default.
Sourcepub fn max_wasm_stack(&mut self, size: usize) -> &mut Self
pub fn max_wasm_stack(&mut self, size: usize) -> &mut Self
Sets the maximum wasm operand-stack size, in bytes.
Sourcepub fn max_module_bytes(&mut self, bytes: usize) -> &mut Self
pub fn max_module_bytes(&mut self, bytes: usize) -> &mut Self
Sets the default maximum module binary size, in bytes, that Module::new will
compile on this engine — the untrusted-tier validation-time ceiling that bounds
compiler memory against a hostile module before it ever executes (#32). Trusted/curated
packages can raise it per-module via Module::new_with_limits.
Additive deviation from wasmtime — there is no analog in wasmtime::Config. The
default is a finite ceiling (256 MiB, never unbounded), per the multi-tenant threat model.
Sourcepub fn max_expanded_locals(&mut self, locals: usize) -> &mut Self
pub fn max_expanded_locals(&mut self, locals: usize) -> &mut Self
Sets the default maximum number of locals, summed over every function after run-length
expansion, that Module::new will compile on this engine. wasmparser caps locals per
function (50 000) but not per module, so without this a small module of many such
functions could demand gigabytes from the compiler. Raised per-module for trusted packages
via Module::new_with_limits.
Additive deviation from wasmtime — there is no analog in wasmtime::Config. The
default is finite (8M locals; ~4× what a 256 MiB real-world module declares).
pub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self
pub fn wasm_tail_call(&mut self, enable: bool) -> &mut Self
pub fn wasm_bulk_memory(&mut self, enable: bool) -> &mut Self
pub fn wasm_reference_types(&mut self, enable: bool) -> &mut Self
pub fn wasm_function_references(&mut self, enable: bool) -> &mut Self
pub fn wasm_gc(&mut self, enable: bool) -> &mut Self
pub fn wasm_exceptions(&mut self, enable: bool) -> &mut Self
pub fn memory_reservation(&mut self, bytes: u64) -> &mut Self
pub fn memory_reservation_for_growth(&mut self, bytes: u64) -> &mut Self
pub fn memory_may_move(&mut self, enable: bool) -> &mut Self
pub fn memory_init_cow(&mut self, enable: bool) -> &mut Self
pub fn memory_guard_size(&mut self, bytes: u64) -> &mut Self
Sourcepub fn gc_heap_reservation(&mut self, bytes: u64) -> &mut Self
pub fn gc_heap_reservation(&mut self, bytes: u64) -> &mut Self
The GC heap’s pre-authorized reservation (bytes): the byte budget a store may grow its
GC heap to without consulting the ResourceLimiter (the embedder has authorized it up
front), and the cap on a single reservation-growth step. Growth beyond it is limiter-gated.
Defaults to 0 (every grow consults the limiter). Unlike wasmtime this reserves a budget,
not address space (we hold no mmap’d region).
pub fn gc_heap_guard_size(&mut self, bytes: u64) -> &mut Self
pub fn gc_heap_reservation_for_growth(&mut self, bytes: u64) -> &mut Self
pub fn gc_heap_may_move(&mut self, enable: bool) -> &mut Self
Sourcepub fn cranelift_opt_level(&mut self, level: OptLevel) -> &mut Self
pub fn cranelift_opt_level(&mut self, level: OptLevel) -> &mut Self
Accepted for wasmtime parity; this interpreter has no Cranelift backend so the optimization level has no effect (compilation is a single linear pre-decode pass).
Sourcepub fn wasm_backtrace(&mut self, enable: bool) -> &mut Self
pub fn wasm_backtrace(&mut self, enable: bool) -> &mut Self
Whether to capture a wasm backtrace on traps/exceptions. On by default. Also gates the
cheap per-Op offset table + name-section retention used to symbolicate frames.
Sourcepub fn wasm_backtrace_details(
&mut self,
enable: WasmBacktraceDetails,
) -> &mut Self
pub fn wasm_backtrace_details( &mut self, enable: WasmBacktraceDetails, ) -> &mut Self
Whether wasm backtraces carry DWARF file/line detail. Defaults to
WasmBacktraceDetails::Environment.
Sourcepub fn debug_info(&mut self, enable: bool) -> &mut Self
pub fn debug_info(&mut self, enable: bool) -> &mut Self
Whether to retain the module’s DWARF debug info. Off by default. The native-debugger aspect
is a no-op for an interpreter, but the retained DWARF symbolicates backtraces (ARCHITECTURE
§16), so enabling this gives source-level frames regardless of wasm_backtrace_details.
Sourcepub fn gc_memory_threshold(&mut self, bytes: usize) -> &mut Self
pub fn gc_memory_threshold(&mut self, bytes: usize) -> &mut Self
Engine-wide GC-pressure high-water mark, in bytes.
Additive deviation from wasmtime — there is no analog in wasmtime::Config.
When total committed GC bytes across all stores of the engine cross this value,
the engine requests collection from its stores (checked at the fuel/epoch
back-edge safe point). Defaults to ~80% of detected physical RAM if unset.
See docs/ARCHITECTURE.md §14.
pub fn collector(&mut self, collector: Collector) -> &mut Self
Sourcepub fn async_support(&mut self, enable: bool) -> &mut Self
pub fn async_support(&mut self, enable: bool) -> &mut Self
Enables async execution (Func::call_async, async host fns, yields).
Off by default. Once enabled, the sync entry points reject this store.
Sourcepub fn async_stack_size(&mut self, size: usize) -> &mut Self
pub fn async_stack_size(&mut self, size: usize) -> &mut Self
Accepted for wasmtime API parity but a no-op for this interpreter:
suspend/resume is just parking the Execution state machine (no native
fiber stack to size — see ARCHITECTURE §2.4), so there is no async stack.