JsValue

Struct JsValue 

Source
pub struct JsValue { /* private fields */ }
Expand description

An opaque reference to a JavaScript heap object.

This type is the wry-bindgen equivalent of wasm-bindgen’s JsValue. It represents any JavaScript value and is used as the base type for all imported JS types.

JsValue is intentionally opaque - you cannot inspect or create values directly. All values come from JavaScript via the IPC protocol.

Unlike wasm-bindgen which runs in a single-threaded Wasm environment, this implementation uses the IPC protocol to communicate with JS.

Implementations§

Source§

impl JsValue

Source

pub const NULL: JsValue

The null JS value constant.

Source

pub const UNDEFINED: JsValue

The undefined JS value constant.

Source

pub const TRUE: JsValue

The true JS value constant.

Source

pub const FALSE: JsValue

The false JS value constant.

Source

pub fn id(&self) -> u64

Get the heap ID for this value.

This is used internally for encoding values to send to JS.

Source

pub fn unchecked_into_f64(&self) -> f64

Returns the value as f64 without type checking. Used by serde-wasm-bindgen for numeric conversions.

Source

pub fn has_type<T>(&self) -> bool
where T: JsCast,

Check if this value is an instance of a specific JS type.

Source

pub fn into_abi(self) -> u32

Get the internal ABI representation (heap index), consuming self. This is used by the convert module for low-level interop. Returns u32 for wasm-bindgen compatibility.

Source

pub const fn undefined() -> JsValue

Creates a new JS value representing undefined.

Source

pub const fn null() -> JsValue

Creates a new JS value representing null.

Source

pub const fn from_bool(b: bool) -> JsValue

Creates a new JS value which is a boolean.

Source

pub fn from_str(s: &str) -> JsValue

Creates a JS string from a Rust string.

Source

pub fn from_f64(n: f64) -> JsValue

Creates a JS number from an f64.

Source§

impl JsValue

Source

pub fn checked_div(&self, rhs: &JsValue) -> JsValue

Checked division.

Source

pub fn pow(&self, rhs: &JsValue) -> JsValue

Power operation.

Source

pub fn bit_and(&self, rhs: &JsValue) -> JsValue

Bitwise AND.

Source

pub fn bit_or(&self, rhs: &JsValue) -> JsValue

Bitwise OR.

Source

pub fn bit_xor(&self, rhs: &JsValue) -> JsValue

Bitwise XOR.

Source

pub fn bit_not(&self) -> JsValue

Bitwise NOT.

Source

pub fn shl(&self, rhs: &JsValue) -> JsValue

Left shift.

Source

pub fn shr(&self, rhs: &JsValue) -> JsValue

Signed right shift.

Source

pub fn unsigned_shr(&self, rhs: &JsValue) -> u32

Unsigned right shift.

Source

pub fn add(&self, rhs: &JsValue) -> JsValue

Add.

Source

pub fn sub(&self, rhs: &JsValue) -> JsValue

Subtract.

Source

pub fn mul(&self, rhs: &JsValue) -> JsValue

Multiply.

Source

pub fn div(&self, rhs: &JsValue) -> JsValue

Divide.

Source

pub fn rem(&self, rhs: &JsValue) -> JsValue

Remainder.

Source

pub fn neg(&self) -> JsValue

Negate.

Source

pub fn lt(&self, rhs: &JsValue) -> bool

Less than comparison.

Source

pub fn le(&self, rhs: &JsValue) -> bool

Less than or equal comparison.

Source

pub fn gt(&self, rhs: &JsValue) -> bool

Greater than comparison.

Source

pub fn ge(&self, rhs: &JsValue) -> bool

Greater than or equal comparison.

Source

pub fn loose_eq(&self, rhs: &JsValue) -> bool

Loose equality (==).

Source

pub fn is_falsy(&self) -> bool

Check if this value is a falsy value in JavaScript.

Source

pub fn is_truthy(&self) -> bool

Check if this value is a truthy value in JavaScript.

Source

pub fn is_object(&self) -> bool

Check if this value is an object.

Source

pub fn is_function(&self) -> bool

Check if this value is a function.

Source

pub fn is_string(&self) -> bool

Check if this value is a string.

Source

pub fn is_symbol(&self) -> bool

Check if this value is a symbol.

Source

pub fn is_bigint(&self) -> bool

Check if this value is a bigint.

Source

pub fn is_undefined(&self) -> bool

Check if this value is undefined.

Source

pub fn is_null(&self) -> bool

Check if this value is null.

Source

pub fn js_typeof(&self) -> JsValue

Get the typeof this value as a string.

Source

pub fn js_in(&self, obj: &JsValue) -> bool

Check if this value has a property with the given name.

Source

pub fn as_bool(&self) -> Option<bool>

Get the value as a bool.

Source

pub fn as_f64(&self) -> Option<f64>

Get the value as an f64.

Source

pub fn as_string(&self) -> Option<String>

Get the value as a string.

Source

pub fn as_debug_string(&self) -> String

Get a debug string representation of the value.

Trait Implementations§

Source§

impl Add<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &JsValue) -> JsValue

Performs the + operation. Read more
Source§

impl Add<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &JsValue) -> JsValue

Performs the + operation. Read more
Source§

impl<'a> Add<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the + operator.
Source§

fn add(self, rhs: JsValue) -> JsValue

Performs the + operation. Read more
Source§

impl Add for JsValue

Source§

type Output = JsValue

The resulting type after applying the + operator.
Source§

fn add(self, rhs: JsValue) -> JsValue

Performs the + operation. Read more
Source§

impl<T> AsRef<JsValue> for Closure<T>
where T: ?Sized,

Source§

fn as_ref(&self) -> &JsValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsValue> for JsError

Source§

fn as_ref(&self) -> &JsValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsValue> for JsValue

Source§

fn as_ref(&self) -> &JsValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl BatchableResult for JsValue

Source§

fn try_placeholder(batch: &mut Runtime) -> Option<JsValue>

Returns Some(placeholder) for opaque types that can be batched, None for types that require flushing to get the actual value. Read more
Source§

impl BinaryDecode for JsValue

Source§

impl BinaryEncode for &JsValue

Source§

fn encode(self, encoder: &mut EncodedData)

Source§

impl BinaryEncode for JsValue

Source§

fn encode(self, encoder: &mut EncodedData)

Source§

impl BitAnd<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &JsValue) -> JsValue

Performs the & operation. Read more
Source§

impl BitAnd<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &JsValue) -> JsValue

Performs the & operation. Read more
Source§

impl<'a> BitAnd<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: JsValue) -> JsValue

Performs the & operation. Read more
Source§

impl BitAnd for JsValue

Source§

type Output = JsValue

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: JsValue) -> JsValue

Performs the & operation. Read more
Source§

impl BitOr<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &JsValue) -> JsValue

Performs the | operation. Read more
Source§

impl BitOr<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &JsValue) -> JsValue

Performs the | operation. Read more
Source§

impl<'a> BitOr<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: JsValue) -> JsValue

Performs the | operation. Read more
Source§

impl BitOr for JsValue

Source§

type Output = JsValue

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: JsValue) -> JsValue

Performs the | operation. Read more
Source§

impl BitXor<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &JsValue) -> JsValue

Performs the ^ operation. Read more
Source§

impl BitXor<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &JsValue) -> JsValue

Performs the ^ operation. Read more
Source§

impl<'a> BitXor<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: JsValue) -> JsValue

Performs the ^ operation. Read more
Source§

impl BitXor for JsValue

Source§

type Output = JsValue

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: JsValue) -> JsValue

Performs the ^ operation. Read more
Source§

impl Clone for JsValue

Source§

fn clone(&self) -> JsValue

Returns a duplicate 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 JsValue

Source§

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

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

impl Default for JsValue

Source§

fn default() -> JsValue

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

impl Div<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &JsValue) -> JsValue

Performs the / operation. Read more
Source§

impl Div<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &JsValue) -> JsValue

Performs the / operation. Read more
Source§

impl<'a> Div<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the / operator.
Source§

fn div(self, rhs: JsValue) -> JsValue

Performs the / operation. Read more
Source§

impl Div for JsValue

Source§

type Output = JsValue

The resulting type after applying the / operator.
Source§

fn div(self, rhs: JsValue) -> JsValue

Performs the / operation. Read more
Source§

impl Drop for JsValue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl EncodeTypeDef for JsValue

Source§

fn encode_type_def(buf: &mut Vec<u8>)

Encode this type’s definition into the buffer. For primitives, this is just the TypeTag byte. For callbacks, this includes param count, param types, and return type.
Source§

impl From<&String> for JsValue

Source§

fn from(val: &String) -> JsValue

Converts to this type from the input type.
Source§

impl From<&str> for JsValue

Source§

fn from(val: &str) -> JsValue

Converts to this type from the input type.
Source§

impl From<()> for JsValue

Source§

fn from(val: ()) -> JsValue

Converts to this type from the input type.
Source§

impl From<JsError> for JsValue

Source§

fn from(e: JsError) -> JsValue

Converts to this type from the input type.
Source§

impl From<JsValue> for ()

Source§

fn from(val: JsValue)

Converts to this type from the input type.
Source§

impl From<JsValue> for f32

Source§

fn from(val: JsValue) -> f32

Converts to this type from the input type.
Source§

impl From<JsValue> for i16

Source§

fn from(val: JsValue) -> i16

Converts to this type from the input type.
Source§

impl From<JsValue> for i32

Source§

fn from(val: JsValue) -> i32

Converts to this type from the input type.
Source§

impl From<JsValue> for i8

Source§

fn from(val: JsValue) -> i8

Converts to this type from the input type.
Source§

impl From<JsValue> for isize

Source§

fn from(val: JsValue) -> isize

Converts to this type from the input type.
Source§

impl From<JsValue> for u16

Source§

fn from(val: JsValue) -> u16

Converts to this type from the input type.
Source§

impl From<JsValue> for u32

Source§

fn from(val: JsValue) -> u32

Converts to this type from the input type.
Source§

impl From<JsValue> for u8

Source§

fn from(val: JsValue) -> u8

Converts to this type from the input type.
Source§

impl From<JsValue> for usize

Source§

fn from(val: JsValue) -> usize

Converts to this type from the input type.
Source§

impl<T> From<Option<T>> for JsValue
where T: Into<JsValue>,

Source§

fn from(s: Option<T>) -> JsValue

Converts to this type from the input type.
Source§

impl From<String> for JsValue

Source§

fn from(val: String) -> JsValue

Converts to this type from the input type.
Source§

impl From<bool> for JsValue

Source§

fn from(val: bool) -> JsValue

Converts to this type from the input type.
Source§

impl From<f32> for JsValue

Source§

fn from(val: f32) -> JsValue

Converts to this type from the input type.
Source§

impl From<f64> for JsValue

Source§

fn from(val: f64) -> JsValue

Converts to this type from the input type.
Source§

impl From<i128> for JsValue

Source§

fn from(val: i128) -> JsValue

Converts to this type from the input type.
Source§

impl From<i16> for JsValue

Source§

fn from(val: i16) -> JsValue

Converts to this type from the input type.
Source§

impl From<i32> for JsValue

Source§

fn from(val: i32) -> JsValue

Converts to this type from the input type.
Source§

impl From<i64> for JsValue

Source§

fn from(val: i64) -> JsValue

Converts to this type from the input type.
Source§

impl From<i8> for JsValue

Source§

fn from(val: i8) -> JsValue

Converts to this type from the input type.
Source§

impl From<isize> for JsValue

Source§

fn from(val: isize) -> JsValue

Converts to this type from the input type.
Source§

impl From<u128> for JsValue

Source§

fn from(val: u128) -> JsValue

Converts to this type from the input type.
Source§

impl From<u16> for JsValue

Source§

fn from(val: u16) -> JsValue

Converts to this type from the input type.
Source§

impl From<u32> for JsValue

Source§

fn from(val: u32) -> JsValue

Converts to this type from the input type.
Source§

impl From<u64> for JsValue

Source§

fn from(val: u64) -> JsValue

Converts to this type from the input type.
Source§

impl From<u8> for JsValue

Source§

fn from(val: u8) -> JsValue

Converts to this type from the input type.
Source§

impl From<usize> for JsValue

Source§

fn from(val: usize) -> JsValue

Converts to this type from the input type.
Source§

impl FromWasmAbi for JsValue

Source§

type Abi = u32

The ABI type that this converts from.
Source§

unsafe fn from_abi(js: <JsValue as FromWasmAbi>::Abi) -> JsValue

Convert from the ABI representation to this type. Read more
Source§

impl Hash for JsValue

Source§

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

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 IntoWasmAbi for &JsValue

Source§

type Abi = u32

The ABI type that this converts into.
Source§

fn into_abi(self) -> <&JsValue as IntoWasmAbi>::Abi

Convert this value into its ABI representation.
Source§

impl IntoWasmAbi for JsValue

Source§

type Abi = u32

The ABI type that this converts into.
Source§

fn into_abi(self) -> <JsValue as IntoWasmAbi>::Abi

Convert this value into its ABI representation.
Source§

impl JsCast for JsValue

Implement JsCast for JsValue itself (identity cast)

Source§

fn instanceof(_val: &JsValue) -> bool

Check if a JsValue is an instance of this type. Read more
Source§

fn unchecked_from_js(val: JsValue) -> JsValue

Unchecked cast from JsValue to this type. Read more
Source§

fn unchecked_from_js_ref(val: &JsValue) -> &JsValue

Unchecked cast from a JsValue reference to a reference of this type. Read more
Source§

fn is_type_of(val: &JsValue) -> bool

Performs a dynamic type check to see whether the JsValue provided is a value of this type. Read more
Source§

fn has_type<T>(&self) -> bool
where T: JsCast,

Test whether this JS value has a type T. Read more
Source§

fn dyn_into<T>(self) -> Result<T, Self>
where T: JsCast,

Try to cast this value to type T. Read more
Source§

fn dyn_ref<T>(&self) -> Option<&T>
where T: JsCast,

Try to get a reference to type T from this value. Read more
Source§

fn is_instance_of<T>(&self) -> bool
where T: JsCast,

Test whether this JS value is an instance of the type T. Read more
Source§

fn unchecked_into<T>(self) -> T
where T: JsCast,

Unchecked cast to another type.
Source§

fn unchecked_ref<T>(&self) -> &T
where T: JsCast,

Unchecked cast to a reference of another type.
Source§

impl Mul<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &JsValue) -> JsValue

Performs the * operation. Read more
Source§

impl Mul<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &JsValue) -> JsValue

Performs the * operation. Read more
Source§

impl<'a> Mul<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: JsValue) -> JsValue

Performs the * operation. Read more
Source§

impl Mul for JsValue

Source§

type Output = JsValue

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: JsValue) -> JsValue

Performs the * operation. Read more
Source§

impl Neg for &JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn neg(self) -> JsValue

Performs the unary - operation. Read more
Source§

impl Neg for JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn neg(self) -> JsValue

Performs the unary - operation. Read more
Source§

impl Not for &JsValue

Source§

type Output = bool

The resulting type after applying the ! operator.
Source§

fn not(self) -> <&JsValue as Not>::Output

Performs the unary ! operation. Read more
Source§

impl Not for JsValue

Source§

type Output = bool

The resulting type after applying the ! operator.
Source§

fn not(self) -> <JsValue as Not>::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq<&String> for JsValue

Source§

fn eq(&self, other: &&String) -> 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 PartialEq<&str> for JsValue

Source§

fn eq(&self, other: &&str) -> 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 PartialEq<JsValue> for &String

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for &str

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for String

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for bool

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for f32

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for f64

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for i128

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for i16

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for i32

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for i64

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for i8

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for isize

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for u128

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for u16

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for u32

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for u64

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for u8

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<JsValue> for usize

Source§

fn eq(&self, other: &JsValue) -> 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 PartialEq<String> for JsValue

Source§

fn eq(&self, other: &String) -> 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 PartialEq<bool> for JsValue

Source§

fn eq(&self, other: &bool) -> 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 PartialEq<f32> for JsValue

Source§

fn eq(&self, other: &f32) -> 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 PartialEq<f64> for JsValue

Source§

fn eq(&self, other: &f64) -> 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 PartialEq<i128> for JsValue

Source§

fn eq(&self, other: &i128) -> 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 PartialEq<i16> for JsValue

Source§

fn eq(&self, other: &i16) -> 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 PartialEq<i32> for JsValue

Source§

fn eq(&self, other: &i32) -> 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 PartialEq<i64> for JsValue

Source§

fn eq(&self, other: &i64) -> 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 PartialEq<i8> for JsValue

Source§

fn eq(&self, other: &i8) -> 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 PartialEq<isize> for JsValue

Source§

fn eq(&self, other: &isize) -> 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 PartialEq<str> for JsValue

Source§

fn eq(&self, other: &str) -> 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 PartialEq<u128> for JsValue

Source§

fn eq(&self, other: &u128) -> 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 PartialEq<u16> for JsValue

Source§

fn eq(&self, other: &u16) -> 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 PartialEq<u32> for JsValue

Source§

fn eq(&self, other: &u32) -> 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 PartialEq<u64> for JsValue

Source§

fn eq(&self, other: &u64) -> 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 PartialEq<u8> for JsValue

Source§

fn eq(&self, other: &u8) -> 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 PartialEq<usize> for JsValue

Source§

fn eq(&self, other: &usize) -> 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 PartialEq for JsValue

Source§

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

Source§

type Abi = u32

The ABI type that references to Self are recovered from.
Source§

type Anchor = ManuallyDrop<JsValue>

The type that holds the reference to Self for the duration of the invocation. This ensures lifetimes don’t persist beyond one function call.
Source§

unsafe fn ref_from_abi(js: u32) -> <JsValue as RefFromWasmAbi>::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl Rem<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &JsValue) -> JsValue

Performs the % operation. Read more
Source§

impl Rem<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &JsValue) -> JsValue

Performs the % operation. Read more
Source§

impl<'a> Rem<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: JsValue) -> JsValue

Performs the % operation. Read more
Source§

impl Rem for JsValue

Source§

type Output = JsValue

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: JsValue) -> JsValue

Performs the % operation. Read more
Source§

impl Shl<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &JsValue) -> JsValue

Performs the << operation. Read more
Source§

impl Shl<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &JsValue) -> JsValue

Performs the << operation. Read more
Source§

impl<'a> Shl<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: JsValue) -> JsValue

Performs the << operation. Read more
Source§

impl Shl for JsValue

Source§

type Output = JsValue

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: JsValue) -> JsValue

Performs the << operation. Read more
Source§

impl Shr<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &JsValue) -> JsValue

Performs the >> operation. Read more
Source§

impl Shr<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &JsValue) -> JsValue

Performs the >> operation. Read more
Source§

impl<'a> Shr<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: JsValue) -> JsValue

Performs the >> operation. Read more
Source§

impl Shr for JsValue

Source§

type Output = JsValue

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: JsValue) -> JsValue

Performs the >> operation. Read more
Source§

impl Sub<&JsValue> for &JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &JsValue) -> JsValue

Performs the - operation. Read more
Source§

impl Sub<&JsValue> for JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &JsValue) -> JsValue

Performs the - operation. Read more
Source§

impl<'a> Sub<JsValue> for &'a JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: JsValue) -> JsValue

Performs the - operation. Read more
Source§

impl Sub for JsValue

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: JsValue) -> JsValue

Performs the - operation. Read more
Source§

impl TryFrom<&JsValue> for f64

Source§

type Error = JsValue

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

fn try_from(value: &JsValue) -> Result<f64, <f64 as TryFrom<&JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for String

Source§

type Error = JsValue

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

fn try_from( value: JsValue, ) -> Result<String, <String as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for f64

Source§

type Error = JsValue

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

fn try_from(value: JsValue) -> Result<f64, <f64 as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for i128

Source§

type Error = JsValue

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

fn try_from(value: JsValue) -> Result<i128, <i128 as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for i64

Source§

type Error = JsValue

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

fn try_from(value: JsValue) -> Result<i64, <i64 as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for u128

Source§

type Error = JsValue

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

fn try_from(value: JsValue) -> Result<u128, <u128 as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl TryFrom<JsValue> for u64

Source§

type Error = JsValue

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

fn try_from(value: JsValue) -> Result<u64, <u64 as TryFrom<JsValue>>::Error>

Performs the conversion.
Source§

impl Eq for JsValue

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> RefFromBinaryDecode for T
where T: JsCast + 'static,

Source§

type Anchor = JsCastAnchor<T>

The anchor type that keeps the decoded reference valid.
Source§

fn ref_decode( _decoder: &mut DecodedData<'_>, ) -> Result<<T as RefFromBinaryDecode>::Anchor, DecodeError>

Decode a reference anchor from binary data.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.