Trait workflow_wasm::extensions::object::ObjectExtension
source · pub trait ObjectExtension {
Show 16 methods
// Required methods
fn get(&self, prop: &str) -> Result<JsValue, Error>;
fn get_string(&self, prop: &str) -> Result<String, Error>;
fn get_u8(&self, prop: &str) -> Result<u8, Error>;
fn get_u16(&self, prop: &str) -> Result<u16, Error>;
fn get_u32(&self, prop: &str) -> Result<u32, Error>;
fn get_u64(&self, prop: &str) -> Result<u64, Error>;
fn get_f64(&self, prop: &str) -> Result<f64, Error>;
fn get_bool(&self, prop: &str) -> Result<bool, Error>;
fn get_vec(&self, prop: &str) -> Result<Vec<JsValue>, Error>;
fn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, Error>;
fn get_vec_u8_from_number_array(&self, prop: &str) -> Result<Vec<u8>, Error>;
fn get_vec_u8_from_uint8_array(&self, prop: &str) -> Result<Vec<u8>, Error>;
fn set(&self, prop: &str, value: &JsValue) -> Result<bool, Error>;
fn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, Error>;
fn set_properties(&self, props: &[(&str, &JsValue)]) -> Result<(), Error>;
fn delete(&self, prop: &str) -> Result<bool, Error>;
}
Expand description
Custom trait implementing simplified property accessor functions for Object
.
Required Methods§
sourcefn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, Error>
fn get_vec_u8(&self, prop: &str) -> Result<Vec<u8>, Error>
get Vec<u8>
property from a hex string or an Array
sourcefn get_vec_u8_from_number_array(&self, prop: &str) -> Result<Vec<u8>, Error>
fn get_vec_u8_from_number_array(&self, prop: &str) -> Result<Vec<u8>, Error>
get Uint8Array
property as Vec<u8>
sourcefn get_vec_u8_from_uint8_array(&self, prop: &str) -> Result<Vec<u8>, Error>
fn get_vec_u8_from_uint8_array(&self, prop: &str) -> Result<Vec<u8>, Error>
get Uint8Array
property as Vec<u8>
sourcefn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, Error>
fn set_vec(&self, prop: &str, values: &[JsValue]) -> Result<bool, Error>
set Array
property from &[JsValue]