script_bindings::import::base

Type Alias JSVal

Source
pub(crate) 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 Value

Source§

type Config = ()

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

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

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 post_barrier(v: *mut Value, prev: Value, next: Value)

Place a post-write barrier
Source§

unsafe fn initial() -> Self

Create a default value
Source§

impl Initialize for Value

Source§

unsafe fn initial() -> Option<Value>

Create a default value. If there is no meaningful default possible, returns None. SAFETY: The default must not be a value that can be meaningfully garbage collected.
Source§

impl PartialEq for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RootKind for Value

Source§

const VTABLE: <Value as RootKind>::Vtable = ()

Source§

const KIND: RootKind = JS::RootKind::Value

Source§

type Vtable = ()

Source§

impl ToJSValConvertible for Value

Source§

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

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

impl Traceable for Value

Source§

unsafe fn trace(&self, trc: *mut JSTracer)

Trace self.
Source§

impl Copy for Value

Source§

impl StructuralPartialEq for Value