pub struct Config { /* private fields */ }
Expand description
Configuration for an Engine
.
Implementations§
Source§impl Config
impl Config
Sourcepub fn set_stack_limits(&mut self, stack_limits: StackLimits) -> &mut Self
pub fn set_stack_limits(&mut self, stack_limits: StackLimits) -> &mut Self
Sets the StackLimits
for the Config
.
Sourcepub fn set_cached_stacks(&mut self, amount: usize) -> &mut Self
pub fn set_cached_stacks(&mut self, amount: usize) -> &mut Self
Sourcepub fn wasm_mutable_global(&mut self, enable: bool) -> &mut Self
pub fn wasm_mutable_global(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_sign_extension(&mut self, enable: bool) -> &mut Self
pub fn wasm_sign_extension(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_saturating_float_to_int(&mut self, enable: bool) -> &mut Self
pub fn wasm_saturating_float_to_int(&mut self, enable: bool) -> &mut Self
Enable or disable the saturating-float-to-int
Wasm proposal for the Config
.
§Note
Enabled by default.
Sourcepub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self
pub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_multi_memory(&mut self, enable: bool) -> &mut Self
pub fn wasm_multi_memory(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_bulk_memory(&mut self, enable: bool) -> &mut Self
pub fn wasm_bulk_memory(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_reference_types(&mut self, enable: bool) -> &mut Self
pub fn wasm_reference_types(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_tail_call(&mut self, enable: bool) -> &mut Self
pub fn wasm_tail_call(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_extended_const(&mut self, enable: bool) -> &mut Self
pub fn wasm_extended_const(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_custom_page_sizes(&mut self, enable: bool) -> &mut Self
pub fn wasm_custom_page_sizes(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_memory64(&mut self, enable: bool) -> &mut Self
pub fn wasm_memory64(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_wide_arithmetic(&mut self, enable: bool) -> &mut Self
pub fn wasm_wide_arithmetic(&mut self, enable: bool) -> &mut Self
Enable or disable the wide-arithmetic
Wasm proposal for the Config
.
Disabled by default.
Sourcepub fn wasm_relaxed_simd(&mut self, enable: bool) -> &mut Self
pub fn wasm_relaxed_simd(&mut self, enable: bool) -> &mut Self
Enable or disable the relaxed-simd
Wasm proposal for the Config
.
Enabled by default.
Sourcepub fn floats(&mut self, enable: bool) -> &mut Self
pub fn floats(&mut self, enable: bool) -> &mut Self
Enable or disable Wasm floating point (f32
and f64
) instructions and types.
Enabled by default.
Sourcepub fn consume_fuel(&mut self, enable: bool) -> &mut Self
pub fn consume_fuel(&mut self, enable: bool) -> &mut Self
Configures whether Wasmi will consume fuel during execution to either halt execution as desired.
§Note
This configuration can be used to make Wasmi instrument its internal bytecode
so that it consumes fuel as it executes. Once an execution runs out of fuel
a TrapCode::OutOfFuel
trap is raised.
This way users can deterministically halt or yield the execution of WebAssembly code.
- Use
Store::set_fuel
to set the remaining fuel of theStore
before executing some code as theStore
start with no fuel. - Use
Caller::set_fuel
to update the remaining fuel when executing host functions.
Disabled by default.
Sourcepub fn ignore_custom_sections(&mut self, enable: bool) -> &mut Self
pub fn ignore_custom_sections(&mut self, enable: bool) -> &mut Self
Configures whether Wasmi will ignore custom sections when parsing Wasm modules.
Default value: false
Sourcepub fn compilation_mode(&mut self, mode: CompilationMode) -> &mut Self
pub fn compilation_mode(&mut self, mode: CompilationMode) -> &mut Self
Sets the CompilationMode
used for the Engine
.
By default CompilationMode::Eager
is used.
Sourcepub fn enforced_limits(&mut self, limits: EnforcedLimits) -> &mut Self
pub fn enforced_limits(&mut self, limits: EnforcedLimits) -> &mut Self
Sets the EnforcedLimits
enforced by the Engine
for Wasm module parsing and compilation.
By default no limits are enforced.