Trait workflow_wasm::convert::CastFromJs
source · pub trait CastFromJs{
// Required methods
fn try_ref_from_js_value<'a, R>(
js_value: &'a R,
) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
where R: AsRef<JsValue> + 'a;
fn try_long_ref_from_js_value<'a, R>(
js: &'a R,
) -> Result<<Self as LongRefFromWasmAbi>::Anchor, Error>
where R: AsRef<JsValue> + 'a;
// Provided methods
fn try_ref_from_js_value_as_cast<'a, R>(
js_value: &'a R,
) -> Result<Cast<'a, Self>, Error>
where R: AsRef<JsValue> + 'a { ... }
fn try_long_ref_from_js_value_as_cast<'a, R>(
js: &'a R,
) -> Result<Cast<'_, Self>, Error>
where R: AsRef<JsValue> + 'a { ... }
}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§
sourcefn try_ref_from_js_value<'a, R>(
js_value: &'a R,
) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
fn try_ref_from_js_value<'a, R>( js_value: &'a R, ) -> Result<<Self as RefFromWasmAbi>::Anchor, Error>
Obtain safe reference from JsValue
sourcefn try_long_ref_from_js_value<'a, R>(
js: &'a R,
) -> Result<<Self as LongRefFromWasmAbi>::Anchor, Error>
fn try_long_ref_from_js_value<'a, R>( js: &'a R, ) -> Result<<Self as LongRefFromWasmAbi>::Anchor, Error>
Obtain safe long reference from JsValue
Provided Methods§
fn try_ref_from_js_value_as_cast<'a, R>( js_value: &'a R, ) -> Result<Cast<'a, Self>, Error>
fn try_long_ref_from_js_value_as_cast<'a, R>( js: &'a R, ) -> Result<Cast<'_, Self>, Error>
Object Safety§
This trait is not object safe.