Trait workflow_wasm::convert::CastFromJs

source ·
pub trait CastFromJs
where Self: Sized + RefFromWasmAbi<Abi = u32> + LongRefFromWasmAbi<Abi = u32>,
{ // Required methods fn try_ref_from_js_value( js: impl AsRef<JsValue>, ) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>; fn try_long_ref_from_js_value( js: impl AsRef<JsValue>, ) -> Result<<Self as LongRefFromWasmAbi>::Anchor, Error>; // Provided methods fn try_ref_from_js_value_as_cast( js: impl AsRef<JsValue>, ) -> Result<Cast<Self>, Error> { ... } fn try_long_ref_from_js_value_as_cast( js: impl AsRef<JsValue>, ) -> Result<Cast<Self>, Error> { ... } }
Expand description

CastFromJs trait is automatically implemented by deriving the CastFromJs derive macro. This trait provides functions for accessing Rust references from the WASM ABI.

Required Methods§

source

fn try_ref_from_js_value( js: impl AsRef<JsValue>, ) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>

Obtain safe reference from JsValue

source

fn try_long_ref_from_js_value( js: impl AsRef<JsValue>, ) -> Result<<Self as LongRefFromWasmAbi>::Anchor, Error>

Obtain safe long reference from JsValue

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§