Available on crate feature
dep_js_sys
only.Structs§
- Compile
Error - The
WebAssembly.CompileError()
constructor creates a new WebAssemblyCompileError
object, which indicates an error during WebAssembly decoding or validation. - Exception
- The
WebAssembly.Exception()
constructor creates a newException
object - Global
- The
WebAssembly.Global()
constructor creates a newGlobal
object of the given type and value. - Instance
- A
WebAssembly.Instance
object is a stateful, executable instance of aWebAssembly.Module
. Instance objects contain all the exported WebAssembly functions that allow calling into WebAssembly code from JavaScript. - Link
Error - The
WebAssembly.LinkError()
constructor creates a new WebAssembly LinkError object, which indicates an error during module instantiation (besides traps from the start function). - Memory
- MDN documentation
- Module
- A
WebAssembly.Module
object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, and instantiated multiple times. - Runtime
Error - The
WebAssembly.RuntimeError()
constructor creates a new WebAssemblyRuntimeError
object — the type that is thrown whenever WebAssembly specifies a trap. - Table
- The
WebAssembly.Table()
constructor creates a newTable
object of the given size and element type. - Tag
- The
WebAssembly.Tag()
constructor creates a newTag
object
Functions§
- compile
- The
WebAssembly.compile()
function compiles aWebAssembly.Module
from WebAssembly binary code. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, theWebAssembly.instantiate()
function should be used). - compile_
streaming - The
WebAssembly.compileStreaming()
function compiles aWebAssembly.Module
module directly from a streamed underlying source. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, theWebAssembly.instantiateStreaming()
function should be used). - instantiate_
buffer - The
WebAssembly.instantiate()
function allows you to compile and instantiate WebAssembly code. - instantiate_
module - The
WebAssembly.instantiate()
function allows you to compile and instantiate WebAssembly code. - instantiate_
streaming - The
WebAssembly.instantiateStreaming()
function compiles and instantiates a WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load Wasm code. - validate
- The
WebAssembly.validate()
function validates a given typed array of WebAssembly binary code, returning whether the bytes form a valid Wasm module (true
) or not (false
).