pub struct CommonConfigOptions { /* private fields */ }Expand description
Defines the common configuration options.
CommonConfigOptions is used to set the common configuration options, which are
-
ImportExportMutGlobalssupports mutable imported and exported globals.Also see Import/Export Mutable Globals Proposal.
-
NonTrapFloatToIntConversionssupports the non-trapping float-to-int conversion. -
SignExtensionOperatorssupports new integer instructions for sign-extending 8-bit, 16-bit, and 32-bit values.Also see Sign-extension Operators Proposal.
-
MultiValuesupports functions and instructions with multiple return values, and blocks with inputs.Also see Multi-value Extension.
-
BulkMemoryOperationssupports bulk memory operations.Also see Bulk Memory Operations Proposal.
-
ReferenceTypessupports reference types.Also see Reference Types Proposal.
-
SIMDsupports 128-bit packed SIMD extension to WebAssembly.Also see SIMD Proposal.
-
RelaxSIMDsupports the relaxed SIMD instructions.Also see Relaxed SIMD Proposal.
-
MultiMemoriesenables the use of multiple memories within a single Wasm module.Also see Multiple Memories Proposal.
-
Threadssupports the threading feature.Also see Threading Proposal.
-
TailCallsupports tail call optimization.Also see Tail Call Proposal.
-
ExtendedConstsupports extended constant expressions.Also see Extended Const Expressions Proposal.
-
Annotationssupports annotations in the WASM text format.Also see Annotations Proposal.
-
Memory64supports 64-bit memory indexes.Also see Memory64 Proposal.
-
ExceptionHandlingsupports exception handling.Also see Exception Handling Proposal.
-
FunctionReferencessupports typed function references for WebAssembly.Also see Function References Proposal.
-
GCsupports garbage collection.Also see GC Proposal.
-
Componentsupports the WebAssembly component model. The support is experimental.Also see Component Model Proposal.
Implementations§
Source§impl CommonConfigOptions
impl CommonConfigOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new instance of CommonConfigOptions.
The default options match the default proposal set of WasmEdge 0.17.1, which enables all the proposals of the WebAssembly 3.0 standard:
- mutable_globals: true,
- non_trap_conversions: true,
- sign_extension_operators: true,
- multi_value: true,
- bulk_memory_operations: true,
- reference_types: true,
- simd: true,
- relax_simd: true,
- multi_memories: true,
- threads: false,
- gc: true,
- tail_call: true,
- extended_const: true,
- annotations: false,
- memory64: true,
- exception_handling: true,
- function_references: true,
- component_model: false,
- run_mode: RunMode::Interpreter,
Sourcepub fn from_wasm_standard(standard: WasmStandard) -> Self
pub fn from_wasm_standard(standard: WasmStandard) -> Self
Creates a new instance of CommonConfigOptions with the proposal preset of the given WebAssembly standard.
The proposals that do not belong to the given standard, such as Annotations, Threads,
and Component, are disabled.
§Argument
standardspecifies the WebAssembly standard whose proposal preset is applied.
Sourcepub fn mutable_globals(self, enable: bool) -> Self
pub fn mutable_globals(self, enable: bool) -> Self
Enables or disables the ImportExportMutGlobals option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn non_trap_conversions(self, enable: bool) -> Self
pub fn non_trap_conversions(self, enable: bool) -> Self
Enables or disables the NonTrapFloatToIntConversions option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn sign_extension_operators(self, enable: bool) -> Self
pub fn sign_extension_operators(self, enable: bool) -> Self
Enables or disables the SignExtensionOperators option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn multi_value(self, enable: bool) -> Self
pub fn multi_value(self, enable: bool) -> Self
Enables or disables the MultiValue option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn bulk_memory_operations(self, enable: bool) -> Self
pub fn bulk_memory_operations(self, enable: bool) -> Self
Enables or disables the BulkMemoryOperations option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn reference_types(self, enable: bool) -> Self
pub fn reference_types(self, enable: bool) -> Self
Enables or disables the ReferenceTypes option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn relax_simd(self, enable: bool) -> Self
pub fn relax_simd(self, enable: bool) -> Self
Sourcepub fn multi_memories(self, enable: bool) -> Self
pub fn multi_memories(self, enable: bool) -> Self
Enables or disables the MultiMemories option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn gc(self, enable: bool) -> Self
pub fn gc(self, enable: bool) -> Self
Enables or disables the GC option.
The GC proposal depends on the FunctionReferences and ReferenceTypes proposals: while GC is enabled, the runtime keeps both dependencies enabled and ignores disabling them.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn extended_const(self, enable: bool) -> Self
pub fn extended_const(self, enable: bool) -> Self
Enables or disables the ExtendedConst option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn annotations(self, enable: bool) -> Self
pub fn annotations(self, enable: bool) -> Self
Enables or disables the Annotations option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn exception_handling(self, enable: bool) -> Self
pub fn exception_handling(self, enable: bool) -> Self
Enables or disables the ExceptionHandling option.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn function_references(self, enable: bool) -> Self
pub fn function_references(self, enable: bool) -> Self
Enables or disables the FunctionReferences option.
The FunctionReferences proposal depends on the ReferenceTypes proposal: while FunctionReferences is enabled, the runtime keeps ReferenceTypes enabled and ignores disabling it. Disabling FunctionReferences is ignored while the GC proposal stays enabled.
§Argument
enable- Whether the option turns on or not.
Sourcepub fn component_model(self, enable: bool) -> Self
pub fn component_model(self, enable: bool) -> Self
Enables or disables the Component option.
Notice that the WebAssembly component model support in WasmEdge is experimental.
§Argument
enablespecifies if the option turns on or not.
Sourcepub fn interpreter_mode(self, enable: bool) -> Self
👎Deprecated: use run_mode instead; since WasmEdge 0.17.0, passing false is a no-op
pub fn interpreter_mode(self, enable: bool) -> Self
use run_mode instead; since WasmEdge 0.17.0, passing false is a no-op
Enables or disables the ForceInterpreter option.
§Argument
enable- Whether the option turns on or not.
Sourcepub fn run_mode(self, mode: RunMode) -> Self
pub fn run_mode(self, mode: RunMode) -> Self
Sets the execution mode: interpreter, JIT, or AOT. By default, the mode is RunMode::Interpreter.
Since WasmEdge 0.17.0, only RunMode::Aot loads the AOT custom sections from a universal
WASM file or dlopens a shared-library WASM artifact; in the other modes, the AOT data is
ignored and the WASM runs in the selected engine.
§Argument
mode- The execution mode to set.
Trait Implementations§
Source§impl Clone for CommonConfigOptions
impl Clone for CommonConfigOptions
impl Copy for CommonConfigOptions
Source§impl Debug for CommonConfigOptions
impl Debug for CommonConfigOptions
Source§impl Default for CommonConfigOptions
impl Default for CommonConfigOptions
Source§fn default() -> Self
fn default() -> Self
Creates a new default instance of CommonConfigOptions.
The default options match the default proposal set of WasmEdge 0.17.1, which enables all the proposals of the WebAssembly 3.0 standard:
- mutable_globals: true,
- non_trap_conversions: true,
- sign_extension_operators: true,
- multi_value: true,
- bulk_memory_operations: true,
- reference_types: true,
- simd: true,
- relax_simd: true,
- multi_memories: true,
- threads: false,
- gc: true,
- tail_call: true,
- extended_const: true,
- annotations: false,
- memory64: true,
- exception_handling: true,
- function_references: true,
- component_model: false,
- run_mode: RunMode::Interpreter,