Skip to main content

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 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: JsCast>(&self) -> bool

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

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

Creates a JS value which is a bigint from a string representing a number.

Source

pub fn symbol(description: Option<&str>) -> JsValue

Creates a new JS symbol with the optional description specified.

Source§

impl JsValue

Source

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

Checked division.

Source

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

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: &Self) -> 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, other: &Self) -> bool

Less than comparison.

Source

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

Less than or equal comparison.

Source

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

Greater than comparison.

Source

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

Greater than or equal comparison.

Source

pub fn loose_eq(&self, other: &Self) -> 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_array(&self) -> bool

Check if this value is an Array.

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 is_null_or_undefined(&self) -> bool

Check if this value is null or undefined.

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

Source§

type Output = JsValue

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

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 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 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<T: ?Sized> AsRef<JsValue> for ScopedClosure<'_, T>

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 Undefined

Source§

fn as_ref(&self) -> &JsValue

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

impl AsRef<JsValue> for Null

Source§

fn as_ref(&self) -> &JsValue

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

impl<T> AsRef<JsValue> for JsOption<T>

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<Self>

Source§

impl BinaryDecode for JsValue

Source§

fn decode(decoder: &mut DecodedData<'_>) -> Result<Self, DecodeError>

Source§

impl BinaryEncode for JsValue

Source§

fn encode(self, encoder: &mut EncodedData)

Source§

impl BitAnd for &JsValue

Source§

type Output = JsValue

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

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 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 Clone for JsValue

Source§

fn clone(&self) -> JsValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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

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

impl Default for JsValue

Source§

fn default() -> Self

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

impl Div for &JsValue

Source§

type Output = JsValue

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

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 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 Drop for JsValue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl EncodeTypeDef for JsValue

Source§

impl Eq for JsValue

Source§

impl ErasableGeneric for JsValue

Source§

impl<'a> From<&'a String> for JsValue

Source§

fn from(s: &'a String) -> JsValue

Converts to this type from the input type.
Source§

impl<'a, T> From<&'a T> for JsValue
where T: JsCast,

Source§

fn from(s: &'a T) -> JsValue

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for JsValue

Source§

fn from(s: &'a str) -> JsValue

Converts to this type from the input type.
Source§

impl From<()> for JsValue

Source§

fn from(val: ()) -> Self

Converts to this type from the input type.
Source§

impl<T> From<*const T> for JsValue

Source§

fn from(s: *const T) -> JsValue

Converts to this type from the input type.
Source§

impl<T> From<*mut T> for JsValue

Source§

fn from(s: *mut T) -> JsValue

Converts to this type from the input type.
Source§

impl<T> From<Box<[T]>> for JsValue

Source§

fn from(vector: Box<[T]>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Clamped<Box<[T]>>> for JsValue

Source§

fn from(vector: Clamped<Box<[T]>>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Clamped<Vec<T>>> for JsValue

Source§

fn from(vector: Clamped<Vec<T>>) -> Self

Converts to this type from the input type.
Source§

impl From<JsError> for JsValue

Source§

fn from(error: JsError) -> Self

Converts to this type from the input type.
Source§

impl<T> From<JsOption<T>> for JsValue

Source§

fn from(val: JsOption<T>) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for JsError

Source§

fn from(value: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for Undefined

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for Null

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl<T> From<JsValue> for JsOption<T>

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for i8

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for i16

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for i32

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for u8

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for u16

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for u32

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for f32

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for usize

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for isize

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl From<JsValue> for ()

Source§

fn from(val: JsValue) -> Self

Converts to this type from the input type.
Source§

impl<T> From<NonNull<T>> for JsValue

Source§

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

Converts to this type from the input type.
Source§

impl From<Null> for JsValue

Source§

fn from(val: Null) -> Self

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(s: String) -> JsValue

Converts to this type from the input type.
Source§

impl From<Undefined> for JsValue

Source§

fn from(val: Undefined) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for JsValue

Source§

fn from(vector: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for JsValue

Source§

fn from(s: bool) -> JsValue

Converts to this type from the input type.
Source§

impl From<f32> for JsValue

Source§

fn from(val: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for JsValue

Source§

fn from(val: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for JsValue

Source§

fn from(val: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for JsValue

Source§

fn from(val: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for JsValue

Source§

fn from(val: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for JsValue

Source§

fn from(val: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for JsValue

Source§

fn from(val: i128) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for JsValue

Source§

fn from(val: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for JsValue

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for JsValue

Source§

fn from(val: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for JsValue

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for JsValue

Source§

fn from(val: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for JsValue

Source§

fn from(val: u128) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for JsValue

Source§

fn from(val: usize) -> Self

Converts to this type from the input type.
Source§

impl Hash for JsValue

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 IntoJsGeneric for JsValue

Source§

impl IntoWasmAbi for &JsValue

Source§

fn into_abi(self) -> u32
where Self: Sized + IntoAbiId,

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) -> Self

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

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

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 JsRefEncode for JsValue

Source§

fn js_ref(&self) -> JsRef

Source§

impl Mul for &JsValue

Source§

type Output = JsValue

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

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) -> Self::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) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for JsValue

Source§

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

Compares two JsValues with JS ===, matching wasm-bindgen.

1.0.0 (const: unstable) · 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<'a> PartialEq<&'a String> for JsValue

Source§

fn eq(&self, other: &&'a String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<'a> PartialEq<&'a str> for JsValue

Source§

fn eq(&self, other: &&'a str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 Promising for JsValue

Source§

impl Rem for &JsValue

Source§

type Output = JsValue

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

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

fn shl(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

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

fn shr(self, rhs: Self) -> Self::Output

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

Source§

type Output = JsValue

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

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 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 TryFrom<&JsValue> for f64

Source§

fn try_from(val: &JsValue) -> Result<Self, Self::Error>

Applies the unary + JS operator, matching wasm-bindgen: the coerced number on success (NaN for e.g. “hi”), or the thrown error value (e.g. for a Symbol).

Source§

type Error = JsValue

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

impl TryFrom<JsValue> for u64

Source§

type Error = JsValue

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

fn try_from(v: JsValue) -> Result<Self, JsValue>

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(v: JsValue) -> Result<Self, JsValue>

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(val: JsValue) -> Result<Self, Self::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(v: JsValue) -> Result<Self, JsValue>

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(v: JsValue) -> Result<Self, JsValue>

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<Self, Self::Error>

Performs the conversion.
Source§

impl UpcastFrom<()> for JsValue

Source§

impl UpcastFrom<JsError> for JsValue

Source§

impl<T> UpcastFrom<JsOption<T>> for JsValue

Source§

impl UpcastFrom<JsValue> for JsValue

Source§

impl UpcastFrom<JsValue> for JsOption<JsValue>

Source§

impl UpcastFrom<Null> for JsValue

Source§

impl UpcastFrom<Undefined> for JsValue

Source§

impl UpcastFrom<bool> for JsValue

Source§

impl UpcastFrom<char> for JsValue

Source§

impl UpcastFrom<f32> for JsValue

Source§

impl UpcastFrom<f64> for JsValue

Source§

impl UpcastFrom<i8> for JsValue

Source§

impl UpcastFrom<i16> for JsValue

Source§

impl UpcastFrom<i32> for JsValue

Source§

impl UpcastFrom<i64> for JsValue

Source§

impl UpcastFrom<i128> for JsValue

Source§

impl UpcastFrom<isize> for JsValue

Source§

impl UpcastFrom<u8> for JsValue

Source§

impl UpcastFrom<u16> for JsValue

Source§

impl UpcastFrom<u32> for JsValue

Source§

impl UpcastFrom<u64> for JsValue

Source§

impl UpcastFrom<u128> for JsValue

Source§

impl UpcastFrom<usize> 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> FromJsFuture for T
where T: TryFromJsValue,

Source§

impl<T> FromWasmAbi for T
where T: JsGeneric,

Source§

unsafe fn from_abi(js: u32) -> Self
where Self: Sized + FromAbiId,

Recreate a JS-reference-like value from a heap id. Read more
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> IntoWasmAbi for T
where T: JsGeneric,

Source§

fn into_abi(self) -> u32
where Self: Sized + IntoAbiId,

Source§

impl<T> JsGeneric for T

Source§

impl<T> OptionFromWasmAbi for T
where T: FromWasmAbi,

Source§

impl<T> OptionIntoWasmAbi for T
where T: IntoWasmAbi,

Source§

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

Source§

unsafe fn ref_from_abi(js: u32) -> AbiRef<Self>
where Self: Sized + FromAbiId,

Recreate a non-dropping reference anchor from a heap id. Read more
Source§

impl<T> ReturnAbi<Anchored> for T

Source§

type Wire = <T as Promising>::Resolution

The type whose TypeDef is advertised to JS for this return value.
Source§

impl<T> ReturnAbi<CallScoped> for T
where T: IntoWasmAbi,

Source§

type Wire = T

The type whose TypeDef is advertised to JS for this return value.
Source§

impl<T> ReturnAsync for T

Source§

impl<T> ReturnSync for T
where T: IntoWasmAbi,

Source§

fn return_abi(self, encoder: &mut EncodedData)

Encode self as the function’s return payload.
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> TryFromJsValue for T
where T: JsCast,

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = <Self as ErasableGeneric>::Repr>,

Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = <Self as ErasableGeneric>::Repr>,

Source§

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