Expand description
Runtime support for the wasm-bindgen tool
This crate contains the runtime support necessary for wasm-bindgen the
attribute and tool. Crates pull in the #[wasm_bindgen] attribute through
this crate and this crate also provides JS bindings through the JsValue
interface.
Modules§
- closure
- Support for long-lived closures in
wasm-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 to access it at runtime.
Structs§
- Clamped
- A wrapper type around slices and vectors for binding the
Uint8ClampedArrayarray in JS. - JsError
- Convenience type for use on exported
fn() -> Result<T, JsError>functions, where you wish to throw a JavaScriptErrorobject. - JsStatic
Deprecated - 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.
- Unwrap
Throw Ext - An extension trait for
Option<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’s
WebAssembly.Instance.prototype.exports - externref_
heap_ live_ count - Get the count of live
externrefs /JsValues inwasm-bindgen’s heap. - function_
table - Returns a handle to this wasm instance’s
WebAssembly.Tablewhich is the indirect 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’s
WebAssembly.Memory - module
- Returns a handle to this Wasm instance’s
WebAssembly.Module. This is only available when the final Wasm app is built with--target no-modulesor--target web. - throw_
str - Throws a JS exception.
- throw_
val - Rethrow a JS exception
- unintern
- Removes a Rust string from the intern cache.