Expand description
wry-bindgen - Runtime support for wasm-bindgen-style bindings over Wry’s WebView
This crate provides the runtime types and traits needed for the #[wasm_bindgen]
attribute macro to generate code that works with Wry’s IPC protocol.
§Architecture
The crate is organized into several modules:
Re-exports§
pub use closure::Closure;pub use closure::ScopedClosure;pub use convert::IntoJsGeneric;pub use convert::JsGeneric;
Modules§
- closure
- Closure compatibility types and traits.
- convert
- Conversion traits for wasm-bindgen API compatibility.
- prelude
- Prelude module for common imports
- sys
- JavaScript system value wrappers and promise compatibility traits.
Macros§
- link_to
- Link to a JS file for use with workers/worklets.
Structs§
- Clamped
- A wrapper type around slices and vectors for binding
Uint8ClampedArray. - JsError
- A JavaScript Error object.
- JsStatic
Deprecated - Legacy wrapper for imported statics.
- JsThread
Local - Backwards-compatible name used by generated
thread_local_v2bindings. - JsValue
- An opaque reference to a JavaScript heap object.
- Lazy
Cell - A runtime-local accessor for lazily initialized JavaScript values.
- Parent
- Storage wrapper for the auto-injected parent field on extended Rust types.
Traits§
- Erasable
Generic - Marker for types whose generic parameters erase to one stable runtime representation.
- JsCast
- Trait for types that can be cast to and from JsValue.
- Unwrap
Throw Ext - Extension trait for Option to unwrap or throw a JS error. This is API-compatible with wasm-bindgen’s UnwrapThrowExt.
Functions§
- exports
- Returns a handle to this Wasm instance’s
WebAssembly.Instance.prototype.exports. - externref_
heap_ live_ count - Returns the number of live JS heap references.
- function_
table - Returns a handle to this Wasm instance’s
WebAssembly.Table(indirect function table). - instance
- Returns a handle to this Wasm instance’s
WebAssembly.Instance. - intern
- memory
- Returns a handle to this Wasm instance’s
WebAssembly.Memory. - module
- Returns a handle to this Wasm instance’s
WebAssembly.Module. - throw_
str - Throw a JS exception with the given message.
- throw_
val - unintern
Attribute Macros§
- wasm_
bindgen - The main wasm_bindgen attribute macro.