Type Alias mozjs::jsval::JSVal

source ·
pub type JSVal = Value;

Aliased Type§

struct JSVal {
    pub asBits_: u64,
}

Fields§

§asBits_: u64

Implementations§

source§

impl Value

source

pub fn is_undefined(&self) -> bool

source

pub fn is_null(&self) -> bool

source

pub fn is_null_or_undefined(&self) -> bool

source

pub fn is_boolean(&self) -> bool

source

pub fn is_int32(&self) -> bool

source

pub fn is_double(&self) -> bool

source

pub fn is_number(&self) -> bool

source

pub fn is_primitive(&self) -> bool

source

pub fn is_string(&self) -> bool

source

pub fn is_object(&self) -> bool

source

pub fn is_object_or_null(&self) -> bool

source

pub fn is_magic(&self) -> bool

source

pub fn is_symbol(&self) -> bool

source

pub fn is_bigint(&self) -> bool

source

pub fn is_gcthing(&self) -> bool

source

pub fn to_boolean(&self) -> bool

source

pub fn to_int32(&self) -> i32

source

pub fn to_double(&self) -> f64

source

pub fn to_number(&self) -> f64

source

pub fn to_string(&self) -> *mut JSString

source

pub fn to_object(&self) -> *mut JSObject

source

pub fn to_object_or_null(&self) -> *mut JSObject

source

pub fn to_symbol(&self) -> *mut Symbol

source

pub fn to_bigint(&self) -> *mut BigInt

source

pub fn to_private(&self) -> *const c_void

source

pub fn to_gcthing(&self) -> *mut c_void

source

pub fn is_markable(&self) -> bool

source

pub fn trace_kind(&self) -> TraceKind

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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 CustomTrace for Value

source§

impl Debug for Value

source§

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

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

impl Default for Value

source§

fn default() -> Value

Returns the “default value” for a type. Read more
source§

impl FromJSValConvertible for JSVal

§

type Config = ()

Optional configurable behaviour switch; use () for no configuration.
source§

unsafe fn from_jsval( _cx: *mut JSContext, value: HandleValue<'_>, _option: () ) -> Result<ConversionResult<JSVal>, ()>

Convert val to type Self. Optional configuration of type T can be passed as the option argument. If it returns Err(()), a JSAPI exception is pending. If it returns Ok(Failure(reason)), there is no pending JSAPI exception.
source§

impl GCMethods for Value

source§

unsafe fn initial() -> Value

Create a default value
source§

unsafe fn post_barrier(v: *mut Value, prev: Value, next: Value)

Place a post-write barrier
source§

impl PartialEq<Value> for Value

source§

fn eq(&self, other: &Value) -> 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 RootKind for Value

source§

fn rootKind() -> RootKind

Returns the rooting kind for Self.
source§

impl ToJSValConvertible for JSVal

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
source§

impl Copy for Value

source§

impl StructuralPartialEq for Value