Trait wasm_bindgen::convert::FromWasmAbi
source · pub trait FromWasmAbi: WasmDescribe {
type Abi: WasmAbi;
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self;
}
Expand description
A trait for anything that can be recovered by-value from the wasm ABI
boundary, eg a Rust u8
can be recovered from the wasm ABI u32
type.
This is the by-value variant of the opposite operation as IntoWasmAbi
.
Required Associated Types
Required Methods
sourceunsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
unsafe fn from_abi(js: Self::Abi, extra: &mut dyn Stack) -> Self
Recover a Self
from Self::Abi
.
Safety
This is only safe to call when – and implementations may assume that –
the supplied Self::Abi
was previously generated by a call to <Self as IntoWasmAbi>::into_abi()
or the moral equivalent in JS.