Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

Crate wasm_bindgen

Cratewasm_bindgen 

Source
Expand description

Runtime support for thewasm-bindgen tool

This crate contains the runtime support necessary forwasm-bindgen theattribute and tool. Crates pull in the#[wasm_bindgen] attribute throughthis crate and this crate also provides JS bindings through theJsValueinterface.

§Features

§enable-interning

Enables the internal cache for [wasm_bindgen::intern].

This feature currently enables thestd feature, meaning that it is notcompatible withno_std environments.

§std (default)

Enabling this feature will make the crate depend on the Rust standard library.

Disable this feature to use this crate inno_std environments.

§strict-macro

All warnings the#[wasm_bindgen] macro emits are turned into hard errors.This mainly affects unused attribute options.

§Deprecated features

§serde-serialize

Deprecated: Use theserde-wasm-bindgen crate instead.

Enables theJsValue::from_serde andJsValue::into_serde methods forserializing and deserializing Rust types to and from JavaScript.

§spans

Deprecated: This feature became a no-op in wasm-bindgen v0.2.20 (Sep 7, 2018).

Modules§

closure
Support for long-lived closures inwasm-bindgen
convert
⚠️ Unstable
prelude
A module which is typically glob imported.

Macros§

link_to
This macro takes a JS module as input and returns a URL that can be used toaccess it at runtime.

Structs§

Clamped
A wrapper type around slices and vectors for binding theUint8ClampedArrayarray in JS.
JsError
Convenience type for use on exportedfn() -> Result<T, JsError> functions, where you wish tothrow a JavaScriptError object.
JsStaticDeprecated
Wrapper type for imported statics.
JsThreadLocal
Wrapper type for imported statics.
JsValue
Representation of an object owned by JS.

Traits§

JsCast
A trait for checked and unchecked casting between JS types.
UnwrapThrowExt
An extension trait forOption<T> andResult<T, E> for unwrapping theTvalue, or throwing a JS error if it is not available.

Functions§

exports
Returns a handle to this Wasm instance’sWebAssembly.Instance.prototype.exports
externref_heap_live_count
Get the count of liveexternrefs /JsValues inwasm-bindgen’s heap.
function_table
Returns a handle to this Wasm instance’sWebAssembly.Table which is theindirect function table used by Rust
intern
Interns Rust strings so that it’s much faster to send them to JS.
memory
Returns a handle to this Wasm instance’sWebAssembly.Memory
module
Returns a handle to this Wasm instance’sWebAssembly.Module.This is only available when the final Wasm app is built with--target no-modules or--target web.
throw_str
Throws a JS exception.
throw_val
Rethrow a JS exception
unintern
Removes a Rust string from the intern cache.

[8]ページ先頭

©2009-2025 Movatter.jp