Expand description
§⚠️ Unstable
This is an internal module, no stability guarantees are provided. Use at your own risk.
Structs§
- WasmRet
- A repr(C) struct containing all of the primitives of a
WasmAbitype, in order. - Wasm
Slice - ⚠️ Unstable
Traits§
- From
Caught Exception - The return type of a
catchimport that isn’t aResult: a synchronous JS throw is returned asfrom_caught_exception(e). js-sys implements it forPromise<T>as a rejected promise, so the throw arrives at.await. - From
Wasm Abi - A trait for anything that can be recovered by-value from the Wasm ABI
boundary, eg a Rust
u8can be recovered from the Wasm ABIu32type. - Into
JsGeneric - Value conversion from a type into its canonical
JsGenericform. - Into
Wasm Abi - A trait for anything that can be converted into a type that can cross the
Wasm ABI directly, eg
u32orf64. - JsGeneric
- A convenience trait for types that erase to
JsValue. - JsString
Like - Marker for types that cross the ABI as a JavaScript string.
- Long
RefFrom Wasm Abi - A version of the
RefFromWasmAbitrait with the additional requirement that the reference must remain valid as long as the anchor isn’t dropped. - Maybe
From Wasm Abi - The ABI of
Option<Self>received from JS. SeeMaybeIntoWasmAbi. - Maybe
Into Wasm Abi - The ABI of
Option<Self>. - Nullable
From Wasm Abi - The
Nulltest ofNullable<Self>received from JS. SeeNullableIntoWasmAbi. - Nullable
Into Wasm Abi - The
Nullvalue ofNullable<Self>, which shares the ABI ofOption<Self>with a second spare value besidenone. - Option
From Wasm Abi - Indicates that this type can be received from JS as
Option<Self>over its own ABI. SeeOptionIntoWasmAbi. - Option
Into Wasm Abi - Indicates that this type can be passed to JS as
Option<Self>over its own ABI, which has a spare value forNone. - RefFrom
Wasm Abi - A trait for anything that can be recovered as some sort of shared reference from the Wasm ABI boundary.
- RefInto
Wasm Abi - A type whose shared references can cross the Wasm ABI, i.e.
for<'a> &'a Self: IntoWasmAbi. - RefMut
From Wasm Abi - Dual of the
RefFromWasmAbitrait, except for mutable references. - Return
Wasm Abi - A trait representing how to interpret the return value of a function for the Wasm ABI.
- TryFrom
JsValue TryFromJsValueis a trait for converting a JavaScript value (JsValue) into a Rust type. It is used by thewasm_bindgenproc-macro to allow conversion to user types.- Upcast
- A trait for type-safe generic upcasting.
- Upcast
From - A trait for defining upcast relationships from a source type.
- Vector
From Wasm Abi - Trait for element types to implement FromWasmAbi for vectors of themselves.
- Vector
Into Wasm Abi - Trait for element types to implement IntoWasmAbi for vectors of themselves.
- Vector
RefInto Wasm Abi - How a borrowed
&[Self]crosses to JS. - WasmAbi
- A trait which represents types that can be passed across the Wasm ABI boundary, by being split into multiple Wasm primitive types.
- Wasm
Primitive - A trait for any type which maps to a Wasm primitive type when used in FFI
(
i32,i64,f32, orf64).
Functions§
- js_
value_ ⚠vector_ from_ abi - The mirror of
js_value_vector_into_abi, checking each element withTryFromJsValue. - js_
value_ vector_ into_ abi - The compat form of an owned vector: an in-place sequence of
JsValuehandles, converted to or fromTin Rust. The releasedVec<String>,Vecs of exported structs and numeric enums, and third-party impls cross this way. It has no new uses: an element whose single value crosses without calling into wasm is declared as an encoded sequence instead. - try_
js_ ⚠value_ vector_ from_ abi - The fallible form of
js_value_vector_from_abi.