Skip to main content

Module wasm_api

Module wasm_api 

Source

Structs§

JsHost 🔒
WASM から JS の取り込み関数を呼ぶ。JS が投げた例外は pending に預けて Trap::Host で戻す。
WasmState

Functions§

bytes_of 🔒
バイト列(ArrayBuffer・TypedArray・DataView・配列)を取り出す。
err_obj 🔒
from_wasm 🔒
WASM の値 → JS の値。funcref は { _wasmFuncRef: addr }(prelude が関数にする)。
kind_name 🔒
limits_of 🔒
make_wasm_natives 🔒
__wasm オブジェクト(prelude/wasm.js が使う)。
module_of 🔒
prop_addr 🔒
put_store 🔒
take_store 🔒
to_wasm 🔒
JS の値 → WASM の値(型 t)。
valtype_name 🔒
valtype_of 🔒
wasm_call 🔒
__wasm.call(addr, args)。結果が 1 個ならその値、複数なら配列、無ければ undefined。
wasm_compile 🔒
__wasm.compile(bytes) → モジュールの番号。
wasm_exports 🔒
__wasm.exports(id) → [[name, kind], ...]。
wasm_func_arity 🔒
__wasm.funcArity(addr) → 引数の数。
wasm_global_new 🔒
__wasm.globalNew(type, mutable, value) → グローバルの番号。
wasm_global_op 🔒
__wasm.globalOp(addr, op, value): op は “get” / “set” / “type” / “mutable”。
wasm_imports 🔒
__wasm.imports(id) → [[module, name, kind], ...]。
wasm_instantiate 🔒
__wasm.instantiate(id, imports)。imports はモジュールの取り込みの順に並んだ JS の値。 戻り値は [[name, kind, addr], ...](失敗は {__wasmErr})。
wasm_mem_buffer 🔒
__wasm.memBuffer(addr) → メモリと記憶域を共有する ArrayBuffer。
wasm_mem_grow 🔒
__wasm.memGrow(addr, delta) → 前のページ数(失敗は -1)。
wasm_mem_new 🔒
__wasm.memNew(initial, maximum) → メモリの番号。
wasm_table_new 🔒
__wasm.tableNew(element, initial, maximum) → 表の番号。
wasm_table_op 🔒
__wasm.tableOp(addr, op, i, value): op は “length” / “get” / “set” / “grow”。
wasm_validate 🔒
__wasm.validate(bytes)。