Struct quickjs_runtime::valueref::JSValueRef
source · [−]pub struct JSValueRef { /* private fields */ }
Implementations
sourceimpl JSValueRef
impl JSValueRef
pub fn get_tag(&self) -> i64
pub fn new_no_context(value: JSValue, label: &str) -> Self
pub fn new(
context: *mut JSContext,
value: JSValue,
ref_ct_incr: bool,
ref_ct_decr_on_drop: bool,
label: &str
) -> Self
pub fn get_ref_count(&self) -> i32
sourcepub fn clone_value_incr_rc(&self) -> JSValue
pub fn clone_value_incr_rc(&self) -> JSValue
borrow the value but first increment the refcount, this is useful for when the value is returned or passed to functions
pub fn borrow_value(&self) -> &JSValue
pub fn borrow_value_mut(&mut self) -> &mut JSValue
pub fn is_null_or_undefined(&self) -> bool
sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
return true if the wrapped value represents a JS null value
sourcepub fn is_compiled_function(&self) -> bool
pub fn is_compiled_function(&self) -> bool
return true if the wrapped value represents a compiled function
pub fn is_big_int(&self) -> bool
sourcepub fn is_exception(&self) -> bool
pub fn is_exception(&self) -> bool
return true if the wrapped value represents a JS Exception value
Trait Implementations
sourceimpl Clone for JSValueRef
impl Clone for JSValueRef
sourceimpl<'a> Debug for JSValueRef
impl<'a> Debug for JSValueRef
sourceimpl Drop for JSValueRef
impl Drop for JSValueRef
sourceimpl Hash for JSValueRef
impl Hash for JSValueRef
sourceimpl JsValueAdapter for JSValueRef
impl JsValueAdapter for JSValueRef
type JsRuntimeAdapterType = QuickJsRuntimeAdapter
sourcefn js_get_type(&self) -> JsValueType
fn js_get_type(&self) -> JsValueType
js_get_type returns the rust type of the value (more extensive list than javascript typeof)
fn js_is_typed_array(&self) -> bool
fn js_is_proxy_instance(&self) -> bool
sourcefn js_type_of(&self) -> &'static str
fn js_type_of(&self) -> &'static str
js_type_of returns the Javascript typeof string
fn js_to_bool(&self) -> bool
fn js_to_i32(&self) -> i32
fn js_to_f64(&self) -> f64
fn js_to_string(&self) -> Result<String, JsError>
fn js_to_str(&self) -> Result<&str, JsError>
fn js_is_i32(&self) -> bool
fn js_is_f64(&self) -> bool
fn js_is_bool(&self) -> bool
fn js_is_string(&self) -> bool
fn js_is_object(&self) -> bool
fn js_is_function(&self) -> bool
fn js_is_array(&self) -> bool
fn js_is_error(&self) -> bool
fn js_is_promise(&self) -> bool
fn js_is_null_or_undefined(&self) -> bool
sourceimpl PartialEq<JSValueRef> for JSValueRef
impl PartialEq<JSValueRef> for JSValueRef
impl Eq for JSValueRef
Auto Trait Implementations
impl RefUnwindSafe for JSValueRef
impl !Send for JSValueRef
impl !Sync for JSValueRef
impl Unpin for JSValueRef
impl UnwindSafe for JSValueRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more