pub struct OwnedJsArray { /* private fields */ }Implementations§
Source§impl OwnedJsArray
impl OwnedJsArray
pub fn try_from_value(value: OwnedJsValue) -> Result<Self, ValueError>
pub fn length(&self) -> u64
pub fn get_index( &self, index: u32, ) -> Result<Option<OwnedJsValue>, ExecutionError>
pub fn set_index( &self, index: u32, value: OwnedJsValue, ) -> Result<(), ExecutionError>
pub fn push(&self, value: OwnedJsValue) -> Result<(), ExecutionError>
pub fn raw_elements(&self) -> Vec<JSValue>
Methods from Deref<Target = OwnedJsValue>§
pub fn context(&self) -> *mut JSContext
pub fn tag(&self) -> JsTag
Sourcepub unsafe fn as_inner(&self) -> &JSValue
pub unsafe fn as_inner(&self) -> &JSValue
Get the inner JSValue without increasing ref count.
Unsafe because the caller must ensure proper memory management.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Check if this value is undefined.
Sourcepub fn is_short_bigint(&self) -> bool
pub fn is_short_bigint(&self) -> bool
Check if this value is BigInt, but short enough to fit in a i32
Sourcepub fn is_exception(&self) -> bool
pub fn is_exception(&self) -> bool
Check if this value is a Javascript exception.
Sourcepub fn is_array_buffer(&self) -> bool
pub fn is_array_buffer(&self) -> bool
Check if this value is a Javascript array.
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if this value is a Javascript function.
Sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Check if this value is a Javascript function.
Sourcepub fn is_promise(&self) -> bool
pub fn is_promise(&self) -> bool
Check if this value is a Javascript promise.
Sourcepub fn is_weak_set(&self) -> bool
pub fn is_weak_set(&self) -> bool
Check if this value is a Javascript WeakSet.
Sourcepub fn is_weak_map(&self) -> bool
pub fn is_weak_map(&self) -> bool
Check if this value is a Javascript WeakMap.
Sourcepub fn is_weak_ref(&self) -> bool
pub fn is_weak_ref(&self) -> bool
Check if this value is a Javascript WeakRef.
Sourcepub fn is_data_view(&self) -> bool
pub fn is_data_view(&self) -> bool
Check if this value is a Javascript DataView.
Sourcepub fn is_compiled_function(&self) -> bool
pub fn is_compiled_function(&self) -> bool
Check if this value is a bytecode compiled function.
Sourcepub fn to_bool(&self) -> Result<bool, ValueError>
pub fn to_bool(&self) -> Result<bool, ValueError>
Convert this value into a bool
Sourcepub fn to_int(&self) -> Result<i32, ValueError>
pub fn to_int(&self) -> Result<i32, ValueError>
Convert this value into an i32
Sourcepub fn to_float(&self) -> Result<f64, ValueError>
pub fn to_float(&self) -> Result<f64, ValueError>
Convert this value into an f64
Sourcepub fn to_string(&self) -> Result<String, ValueError>
pub fn to_string(&self) -> Result<String, ValueError>
Convert this value into a string
pub fn to_array(&self) -> Result<OwnedJsArray, ValueError>
pub fn get_proxy_target( &self, recursive: bool, ) -> Result<OwnedJsValue, ValueError>
pub fn to_date(&self) -> Result<DateTime<Utc>, ValueError>
pub fn to_bigint(&self) -> Result<BigInt, ValueError>
Sourcepub fn js_to_string(&self) -> Result<String, ExecutionError>
pub fn js_to_string(&self) -> Result<String, ExecutionError>
Call the Javascript .toString() method on this value.
Sourcepub fn to_json_string(&self, space: u8) -> Result<String, ExecutionError>
pub fn to_json_string(&self, space: u8) -> Result<String, ExecutionError>
Call the Javascript JSON.stringify() method on this value.