Trait wasm_bridge_js::ToJsValue
source · pub trait ToJsValue: Sized {
type ReturnAbi: ReturnWasmAbi + IntoWasmAbi;
// Required methods
fn to_js_value(&self) -> JsValue;
fn into_return_abi(self) -> Result<Self::ReturnAbi, JsValue>;
// Provided methods
fn number_of_args() -> u32 { ... }
fn to_function_args(&self) -> Array { ... }
fn create_array_of_size(size: u32) -> JsValue { ... }
}
Required Associated Types§
type ReturnAbi: ReturnWasmAbi + IntoWasmAbi
Required Methods§
fn to_js_value(&self) -> JsValue
sourcefn into_return_abi(self) -> Result<Self::ReturnAbi, JsValue>
fn into_return_abi(self) -> Result<Self::ReturnAbi, JsValue>
When this is returned from a closure
Provided Methods§
sourcefn number_of_args() -> u32
fn number_of_args() -> u32
Number of function arguments when this type is used as a function input type
sourcefn to_function_args(&self) -> Array
fn to_function_args(&self) -> Array
Convert to function arguments when calling a function with this value
sourcefn create_array_of_size(size: u32) -> JsValue
fn create_array_of_size(size: u32) -> JsValue
When converting Vec