Function workflow_wasm::abi::ref_from_abi_safe
source · pub fn ref_from_abi_safe<T>(class: &str, js: &JsValue) -> Result<T, Error>where
T: RefFromWasmAbi<Abi = u32> + Clone,
Expand description
Create a reference to a Rust object from a WASM ABI.
This function validates the supplied object by comparing its constructor.name
value to the supplied
class
name. You can use this function in two forms: ref_from_abi_safe("SomeStruct", jsvalue)
or
via a macro ref_from_abi!(SomeStruct,jsvalue)
.