pub struct QuickJsValueAdapter { /* private fields */ }

Implementations§

source§

impl QuickJsValueAdapter

source

pub fn get_tag(&self) -> i64

source

pub fn new_no_context(value: JSValue, label: &str) -> Self

source

pub fn new( context: *mut JSContext, value: JSValue, ref_ct_incr: bool, ref_ct_decr_on_drop: bool, label: &str ) -> Self

source

pub fn get_ref_count(&self) -> i32

source

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

source

pub fn borrow_value(&self) -> &JSValue

source

pub fn borrow_value_mut(&mut self) -> &mut JSValue

source

pub fn is_null_or_undefined(&self) -> bool

source

pub fn is_undefined(&self) -> bool

return true if the wrapped value represents a JS null value

source

pub fn is_null(&self) -> bool

return true if the wrapped value represents a JS null value

source

pub fn is_bool(&self) -> bool

return true if the wrapped value represents a JS boolean value

source

pub fn is_i32(&self) -> bool

return true if the wrapped value represents a JS INT value

source

pub fn is_module(&self) -> bool

return true if the wrapped value represents a Module

source

pub fn is_compiled_function(&self) -> bool

return true if the wrapped value represents a compiled function

source

pub fn is_f64(&self) -> bool

return true if the wrapped value represents a JS F64 value

source

pub fn is_big_int(&self) -> bool

source

pub fn is_exception(&self) -> bool

return true if the wrapped value represents a JS Exception value

source

pub fn is_object(&self) -> bool

return true if the wrapped value represents a JS Object value

source

pub fn is_string(&self) -> bool

return true if the wrapped value represents a JS String value

source§

impl QuickJsValueAdapter

source

pub fn is_function(&self) -> bool

source

pub fn is_array(&self) -> bool

source

pub fn is_error(&self) -> bool

source

pub fn is_promise(&self) -> bool

source

pub fn get_js_type(&self) -> JsValueType

source

pub fn is_typed_array(&self) -> bool

source

pub fn is_proxy_instance(&self) -> bool

source

pub fn type_of(&self) -> &'static str

source

pub fn to_bool(&self) -> bool

source

pub fn to_i32(&self) -> i32

source

pub fn to_f64(&self) -> f64

source

pub fn to_string(&self) -> Result<String, JsError>

source

pub fn to_str(&self) -> Result<&str, JsError>

Trait Implementations§

source§

impl Clone for QuickJsValueAdapter

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QuickJsValueAdapter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for QuickJsValueAdapter

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hash for QuickJsValueAdapter

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<QuickJsValueAdapter> for QuickJsValueAdapter

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for QuickJsValueAdapter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V