Trait workflow_wasm::object::ObjectTrait
source · pub trait ObjectTrait {
// Required methods
fn get(&self, prop: &str) -> Result<JsValue, JsValue>;
fn get_string(&self, prop: &str) -> Result<String, JsValue>;
fn get_u64(&self, prop: &str) -> Result<u64, JsValue>;
fn get_f64(&self, prop: &str) -> Result<f64, JsValue>;
fn get_bool(&self, prop: &str) -> Result<bool, JsValue>;
fn get_vec(&self, prop: &str) -> Result<Vec<JsValue>, JsValue>;
fn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, JsValue>;
fn set(&self, prop: &str, value: &JsValue) -> Result<bool, JsValue>;
fn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, JsValue>;
fn set_properties(&self, props: &[(&str, &JsValue)]) -> Result<(), JsValue>;
fn delete(&self, prop: &str) -> Result<bool, JsValue>;
}
Expand description
Custom trait implementing simplified property accessor functions for Object
.
Required Methods§
sourcefn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, JsValue>
fn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, JsValue>
get Uint8Array
property as Vec<u8>
sourcefn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, JsValue>
fn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, JsValue>
set Array
property from &[JsValue]