pub struct JsValue { /* private fields */ }Expand description
Representation of an object owned by JS.
A JsValue doesn’t actually live in Rust right now but actually in a table
owned by the wasm-bindgen generated JS glue code. Eventually the ownership
will transfer into Wasm directly and this will likely become more efficient,
but for now it may be slightly slow.
Implementations§
Source§impl JsValue
impl JsValue
Sourcepub fn from_str(s: &str) -> JsValue
pub fn from_str(s: &str) -> JsValue
Creates a new JS value which is a string.
The utf-8 string provided is copied to the JS heap and the string will be owned by the JS garbage collector.
Sourcepub fn from_f64(n: f64) -> JsValue
pub fn from_f64(n: f64) -> JsValue
Creates a new JS value which is a number.
This function creates a JS value representing a number (a heap allocated number) and returns a handle to the JS version of it.
Sourcepub fn bigint_from_str(s: &str) -> JsValue
pub fn bigint_from_str(s: &str) -> JsValue
Creates a new JS value which is a bigint from a string representing a number.
This function creates a JS value representing a bigint (a heap allocated large integer) and returns a handle to the JS version of it.
Sourcepub const fn from_bool(b: bool) -> JsValue
pub const fn from_bool(b: bool) -> JsValue
Creates a new JS value which is a boolean.
This function creates a JS object representing a boolean (a heap allocated boolean) and returns a handle to the JS version of it.
Sourcepub fn symbol(description: Option<&str>) -> JsValue
pub fn symbol(description: Option<&str>) -> JsValue
Creates a new JS symbol with the optional description specified.
This function will invoke the Symbol constructor in JS and return the
JS object corresponding to the symbol created.
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Returns the f64 value of this JS value if it’s an instance of a
number.
If this JS value is not an instance of a number then this returns
None.
Sourcepub fn as_string(&self) -> Option<String>
pub fn as_string(&self) -> Option<String>
If this JS value is a string value, this function copies the JS string
value into Wasm linear memory, encoded as UTF-8, and returns it as a
Rust String.
To avoid the copying and re-encoding, consider the
JsString::try_from() function from js-sys
instead.
If this JS value is not an instance of a string or if it’s not valid
utf-8 then this returns None.
§UTF-16 vs UTF-8
JavaScript strings in general are encoded as UTF-16, but Rust strings
are encoded as UTF-8. This can cause the Rust string to look a bit
different than the JS string sometimes. For more details see the
documentation about the str type which contains a few
caveats about the encodings.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns the bool value of this JS value if it’s an instance of a
boolean.
If this JS value is not an instance of a boolean then this returns
None.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Tests whether this JS value is undefined
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Tests whether the type of this JS value is function.
Sourcepub fn js_in(&self, obj: &JsValue) -> bool
pub fn js_in(&self, obj: &JsValue) -> bool
Applies the binary in JS operator on the two JsValues.
Sourcepub fn loose_eq(&self, other: &JsValue) -> bool
pub fn loose_eq(&self, other: &JsValue) -> bool
Compare two JsValues for equality, using the == operator in JS.
Sourcepub fn unsigned_shr(&self, rhs: &JsValue) -> u32
pub fn unsigned_shr(&self, rhs: &JsValue) -> u32
Applies the binary >>> JS operator on the two JsValues.
Sourcepub fn checked_div(&self, rhs: &JsValue) -> JsValue
pub fn checked_div(&self, rhs: &JsValue) -> JsValue
Applies the binary / JS operator on two JsValues, catching and returning any RangeError thrown.
Sourcepub fn pow(&self, rhs: &JsValue) -> JsValue
pub fn pow(&self, rhs: &JsValue) -> JsValue
Applies the binary ** JS operator on the two JsValues.
Sourcepub fn lt(&self, other: &JsValue) -> bool
pub fn lt(&self, other: &JsValue) -> bool
Applies the binary < JS operator on the two JsValues.
Sourcepub fn le(&self, other: &JsValue) -> bool
pub fn le(&self, other: &JsValue) -> bool
Applies the binary <= JS operator on the two JsValues.
Sourcepub fn ge(&self, other: &JsValue) -> bool
pub fn ge(&self, other: &JsValue) -> bool
Applies the binary >= JS operator on the two JsValues.
Sourcepub fn gt(&self, other: &JsValue) -> bool
pub fn gt(&self, other: &JsValue) -> bool
Applies the binary > JS operator on the two JsValues.
Sourcepub fn unchecked_into_f64(&self) -> f64
pub fn unchecked_into_f64(&self) -> f64
Applies the unary + JS operator on a JsValue. Can throw.
Trait Implementations§
Source§impl AsRef<JsValue> for ArrayBuffer
impl AsRef<JsValue> for ArrayBuffer
Source§impl AsRef<JsValue> for AsyncIterator
impl AsRef<JsValue> for AsyncIterator
Source§impl AsRef<JsValue> for BigInt64Array
impl AsRef<JsValue> for BigInt64Array
Source§impl AsRef<JsValue> for BigUint64Array
impl AsRef<JsValue> for BigUint64Array
Source§impl AsRef<JsValue> for CharacterData
impl AsRef<JsValue> for CharacterData
Source§impl AsRef<JsValue> for ClipboardEvent
impl AsRef<JsValue> for ClipboardEvent
Source§impl AsRef<JsValue> for CompileError
impl AsRef<JsValue> for CompileError
Source§impl AsRef<JsValue> for DateTimeFormat
impl AsRef<JsValue> for DateTimeFormat
Source§impl AsRef<JsValue> for DomRectReadOnly
impl AsRef<JsValue> for DomRectReadOnly
Source§impl AsRef<JsValue> for DomTokenList
impl AsRef<JsValue> for DomTokenList
Source§impl AsRef<JsValue> for EventTarget
impl AsRef<JsValue> for EventTarget
Source§impl AsRef<JsValue> for Float32Array
impl AsRef<JsValue> for Float32Array
Source§impl AsRef<JsValue> for Float64Array
impl AsRef<JsValue> for Float64Array
Source§impl AsRef<JsValue> for FocusEvent
impl AsRef<JsValue> for FocusEvent
Source§impl AsRef<JsValue> for HtmlCollection
impl AsRef<JsValue> for HtmlCollection
Source§impl AsRef<JsValue> for HtmlElement
impl AsRef<JsValue> for HtmlElement
Source§impl AsRef<JsValue> for HtmlInputElement
impl AsRef<JsValue> for HtmlInputElement
Source§impl AsRef<JsValue> for HtmlOptionElement
impl AsRef<JsValue> for HtmlOptionElement
Source§impl AsRef<JsValue> for HtmlSelectElement
impl AsRef<JsValue> for HtmlSelectElement
Source§impl AsRef<JsValue> for InputEvent
impl AsRef<JsValue> for InputEvent
Source§impl AsRef<JsValue> for Int16Array
impl AsRef<JsValue> for Int16Array
Source§impl AsRef<JsValue> for Int32Array
impl AsRef<JsValue> for Int32Array
Source§impl AsRef<JsValue> for IteratorNext
impl AsRef<JsValue> for IteratorNext
Source§impl AsRef<JsValue> for KeyboardEvent
impl AsRef<JsValue> for KeyboardEvent
Source§impl AsRef<JsValue> for MediaQueryList
impl AsRef<JsValue> for MediaQueryList
Source§impl AsRef<JsValue> for MediaQueryListEvent
impl AsRef<JsValue> for MediaQueryListEvent
Source§impl AsRef<JsValue> for MouseEvent
impl AsRef<JsValue> for MouseEvent
Source§impl AsRef<JsValue> for NumberFormat
impl AsRef<JsValue> for NumberFormat
Source§impl AsRef<JsValue> for PluralRules
impl AsRef<JsValue> for PluralRules
Source§impl AsRef<JsValue> for PointerEvent
impl AsRef<JsValue> for PointerEvent
Source§impl AsRef<JsValue> for RangeError
impl AsRef<JsValue> for RangeError
Source§impl AsRef<JsValue> for ReferenceError
impl AsRef<JsValue> for ReferenceError
Source§impl AsRef<JsValue> for RelativeTimeFormat
impl AsRef<JsValue> for RelativeTimeFormat
Source§impl AsRef<JsValue> for RequestInit
impl AsRef<JsValue> for RequestInit
Source§impl AsRef<JsValue> for ResponseInit
impl AsRef<JsValue> for ResponseInit
Source§impl AsRef<JsValue> for RuntimeError
impl AsRef<JsValue> for RuntimeError
Source§impl AsRef<JsValue> for SyntaxError
impl AsRef<JsValue> for SyntaxError
Source§impl AsRef<JsValue> for TouchEvent
impl AsRef<JsValue> for TouchEvent
Source§impl AsRef<JsValue> for Uint16Array
impl AsRef<JsValue> for Uint16Array
Source§impl AsRef<JsValue> for Uint32Array
impl AsRef<JsValue> for Uint32Array
Source§impl AsRef<JsValue> for Uint8Array
impl AsRef<JsValue> for Uint8Array
Source§impl AsRef<JsValue> for Uint8ClampedArray
impl AsRef<JsValue> for Uint8ClampedArray
Source§impl AsRef<JsValue> for UrlSearchParams
impl AsRef<JsValue> for UrlSearchParams
Source§impl From<ArrayBuffer> for JsValue
impl From<ArrayBuffer> for JsValue
Source§fn from(obj: ArrayBuffer) -> JsValue
fn from(obj: ArrayBuffer) -> JsValue
Source§impl From<AsyncIterator> for JsValue
impl From<AsyncIterator> for JsValue
Source§fn from(obj: AsyncIterator) -> JsValue
fn from(obj: AsyncIterator) -> JsValue
Source§impl From<BigInt64Array> for JsValue
impl From<BigInt64Array> for JsValue
Source§fn from(obj: BigInt64Array) -> JsValue
fn from(obj: BigInt64Array) -> JsValue
Source§impl From<BigUint64Array> for JsValue
impl From<BigUint64Array> for JsValue
Source§fn from(obj: BigUint64Array) -> JsValue
fn from(obj: BigUint64Array) -> JsValue
Source§impl From<CharacterData> for JsValue
impl From<CharacterData> for JsValue
Source§fn from(obj: CharacterData) -> JsValue
fn from(obj: CharacterData) -> JsValue
Source§impl From<ClipboardEvent> for JsValue
impl From<ClipboardEvent> for JsValue
Source§fn from(obj: ClipboardEvent) -> JsValue
fn from(obj: ClipboardEvent) -> JsValue
Source§impl From<CompileError> for JsValue
impl From<CompileError> for JsValue
Source§fn from(obj: CompileError) -> JsValue
fn from(obj: CompileError) -> JsValue
Source§impl From<DateTimeFormat> for JsValue
impl From<DateTimeFormat> for JsValue
Source§fn from(obj: DateTimeFormat) -> JsValue
fn from(obj: DateTimeFormat) -> JsValue
Source§impl From<DomRectReadOnly> for JsValue
impl From<DomRectReadOnly> for JsValue
Source§fn from(obj: DomRectReadOnly) -> JsValue
fn from(obj: DomRectReadOnly) -> JsValue
Source§impl From<DomTokenList> for JsValue
impl From<DomTokenList> for JsValue
Source§fn from(obj: DomTokenList) -> JsValue
fn from(obj: DomTokenList) -> JsValue
Source§impl From<EventTarget> for JsValue
impl From<EventTarget> for JsValue
Source§fn from(obj: EventTarget) -> JsValue
fn from(obj: EventTarget) -> JsValue
Source§impl From<Float32Array> for JsValue
impl From<Float32Array> for JsValue
Source§fn from(obj: Float32Array) -> JsValue
fn from(obj: Float32Array) -> JsValue
Source§impl From<Float64Array> for JsValue
impl From<Float64Array> for JsValue
Source§fn from(obj: Float64Array) -> JsValue
fn from(obj: Float64Array) -> JsValue
Source§impl From<FocusEvent> for JsValue
impl From<FocusEvent> for JsValue
Source§fn from(obj: FocusEvent) -> JsValue
fn from(obj: FocusEvent) -> JsValue
Source§impl From<HtmlCollection> for JsValue
impl From<HtmlCollection> for JsValue
Source§fn from(obj: HtmlCollection) -> JsValue
fn from(obj: HtmlCollection) -> JsValue
Source§impl From<HtmlElement> for JsValue
impl From<HtmlElement> for JsValue
Source§fn from(obj: HtmlElement) -> JsValue
fn from(obj: HtmlElement) -> JsValue
Source§impl From<HtmlInputElement> for JsValue
impl From<HtmlInputElement> for JsValue
Source§fn from(obj: HtmlInputElement) -> JsValue
fn from(obj: HtmlInputElement) -> JsValue
Source§impl From<HtmlOptionElement> for JsValue
impl From<HtmlOptionElement> for JsValue
Source§fn from(obj: HtmlOptionElement) -> JsValue
fn from(obj: HtmlOptionElement) -> JsValue
Source§impl From<HtmlSelectElement> for JsValue
impl From<HtmlSelectElement> for JsValue
Source§fn from(obj: HtmlSelectElement) -> JsValue
fn from(obj: HtmlSelectElement) -> JsValue
Source§impl From<InputEvent> for JsValue
impl From<InputEvent> for JsValue
Source§fn from(obj: InputEvent) -> JsValue
fn from(obj: InputEvent) -> JsValue
Source§impl From<Int16Array> for JsValue
impl From<Int16Array> for JsValue
Source§fn from(obj: Int16Array) -> JsValue
fn from(obj: Int16Array) -> JsValue
Source§impl From<Int32Array> for JsValue
impl From<Int32Array> for JsValue
Source§fn from(obj: Int32Array) -> JsValue
fn from(obj: Int32Array) -> JsValue
Source§impl From<IteratorNext> for JsValue
impl From<IteratorNext> for JsValue
Source§fn from(obj: IteratorNext) -> JsValue
fn from(obj: IteratorNext) -> JsValue
Source§impl From<JsValue> for ArrayBuffer
impl From<JsValue> for ArrayBuffer
Source§fn from(obj: JsValue) -> ArrayBuffer
fn from(obj: JsValue) -> ArrayBuffer
Source§impl From<JsValue> for AsyncIterator
impl From<JsValue> for AsyncIterator
Source§fn from(obj: JsValue) -> AsyncIterator
fn from(obj: JsValue) -> AsyncIterator
Source§impl From<JsValue> for BigInt64Array
impl From<JsValue> for BigInt64Array
Source§fn from(obj: JsValue) -> BigInt64Array
fn from(obj: JsValue) -> BigInt64Array
Source§impl From<JsValue> for BigUint64Array
impl From<JsValue> for BigUint64Array
Source§fn from(obj: JsValue) -> BigUint64Array
fn from(obj: JsValue) -> BigUint64Array
Source§impl From<JsValue> for CharacterData
impl From<JsValue> for CharacterData
Source§fn from(obj: JsValue) -> CharacterData
fn from(obj: JsValue) -> CharacterData
Source§impl From<JsValue> for ClipboardEvent
impl From<JsValue> for ClipboardEvent
Source§fn from(obj: JsValue) -> ClipboardEvent
fn from(obj: JsValue) -> ClipboardEvent
Source§impl From<JsValue> for CompileError
impl From<JsValue> for CompileError
Source§fn from(obj: JsValue) -> CompileError
fn from(obj: JsValue) -> CompileError
Source§impl From<JsValue> for DateTimeFormat
impl From<JsValue> for DateTimeFormat
Source§fn from(obj: JsValue) -> DateTimeFormat
fn from(obj: JsValue) -> DateTimeFormat
Source§impl From<JsValue> for DomRectReadOnly
impl From<JsValue> for DomRectReadOnly
Source§fn from(obj: JsValue) -> DomRectReadOnly
fn from(obj: JsValue) -> DomRectReadOnly
Source§impl From<JsValue> for DomTokenList
impl From<JsValue> for DomTokenList
Source§fn from(obj: JsValue) -> DomTokenList
fn from(obj: JsValue) -> DomTokenList
Source§impl From<JsValue> for EventTarget
impl From<JsValue> for EventTarget
Source§fn from(obj: JsValue) -> EventTarget
fn from(obj: JsValue) -> EventTarget
Source§impl From<JsValue> for Float32Array
impl From<JsValue> for Float32Array
Source§fn from(obj: JsValue) -> Float32Array
fn from(obj: JsValue) -> Float32Array
Source§impl From<JsValue> for Float64Array
impl From<JsValue> for Float64Array
Source§fn from(obj: JsValue) -> Float64Array
fn from(obj: JsValue) -> Float64Array
Source§impl From<JsValue> for FocusEvent
impl From<JsValue> for FocusEvent
Source§fn from(obj: JsValue) -> FocusEvent
fn from(obj: JsValue) -> FocusEvent
Source§impl From<JsValue> for HtmlCollection
impl From<JsValue> for HtmlCollection
Source§fn from(obj: JsValue) -> HtmlCollection
fn from(obj: JsValue) -> HtmlCollection
Source§impl From<JsValue> for HtmlElement
impl From<JsValue> for HtmlElement
Source§fn from(obj: JsValue) -> HtmlElement
fn from(obj: JsValue) -> HtmlElement
Source§impl From<JsValue> for HtmlInputElement
impl From<JsValue> for HtmlInputElement
Source§fn from(obj: JsValue) -> HtmlInputElement
fn from(obj: JsValue) -> HtmlInputElement
Source§impl From<JsValue> for HtmlOptionElement
impl From<JsValue> for HtmlOptionElement
Source§fn from(obj: JsValue) -> HtmlOptionElement
fn from(obj: JsValue) -> HtmlOptionElement
Source§impl From<JsValue> for HtmlSelectElement
impl From<JsValue> for HtmlSelectElement
Source§fn from(obj: JsValue) -> HtmlSelectElement
fn from(obj: JsValue) -> HtmlSelectElement
Source§impl From<JsValue> for InputEvent
impl From<JsValue> for InputEvent
Source§fn from(obj: JsValue) -> InputEvent
fn from(obj: JsValue) -> InputEvent
Source§impl From<JsValue> for Int16Array
impl From<JsValue> for Int16Array
Source§fn from(obj: JsValue) -> Int16Array
fn from(obj: JsValue) -> Int16Array
Source§impl From<JsValue> for Int32Array
impl From<JsValue> for Int32Array
Source§fn from(obj: JsValue) -> Int32Array
fn from(obj: JsValue) -> Int32Array
Source§impl From<JsValue> for IteratorNext
impl From<JsValue> for IteratorNext
Source§fn from(obj: JsValue) -> IteratorNext
fn from(obj: JsValue) -> IteratorNext
Source§impl From<JsValue> for KeyboardEvent
impl From<JsValue> for KeyboardEvent
Source§fn from(obj: JsValue) -> KeyboardEvent
fn from(obj: JsValue) -> KeyboardEvent
Source§impl From<JsValue> for MediaQueryList
impl From<JsValue> for MediaQueryList
Source§fn from(obj: JsValue) -> MediaQueryList
fn from(obj: JsValue) -> MediaQueryList
Source§impl From<JsValue> for MediaQueryListEvent
impl From<JsValue> for MediaQueryListEvent
Source§fn from(obj: JsValue) -> MediaQueryListEvent
fn from(obj: JsValue) -> MediaQueryListEvent
Source§impl From<JsValue> for MouseEvent
impl From<JsValue> for MouseEvent
Source§fn from(obj: JsValue) -> MouseEvent
fn from(obj: JsValue) -> MouseEvent
Source§impl From<JsValue> for NumberFormat
impl From<JsValue> for NumberFormat
Source§fn from(obj: JsValue) -> NumberFormat
fn from(obj: JsValue) -> NumberFormat
Source§impl From<JsValue> for PluralRules
impl From<JsValue> for PluralRules
Source§fn from(obj: JsValue) -> PluralRules
fn from(obj: JsValue) -> PluralRules
Source§impl From<JsValue> for PointerEvent
impl From<JsValue> for PointerEvent
Source§fn from(obj: JsValue) -> PointerEvent
fn from(obj: JsValue) -> PointerEvent
Source§impl From<JsValue> for RangeError
impl From<JsValue> for RangeError
Source§fn from(obj: JsValue) -> RangeError
fn from(obj: JsValue) -> RangeError
Source§impl From<JsValue> for ReferenceError
impl From<JsValue> for ReferenceError
Source§fn from(obj: JsValue) -> ReferenceError
fn from(obj: JsValue) -> ReferenceError
Source§impl From<JsValue> for RelativeTimeFormat
impl From<JsValue> for RelativeTimeFormat
Source§fn from(obj: JsValue) -> RelativeTimeFormat
fn from(obj: JsValue) -> RelativeTimeFormat
Source§impl From<JsValue> for RequestInit
impl From<JsValue> for RequestInit
Source§fn from(obj: JsValue) -> RequestInit
fn from(obj: JsValue) -> RequestInit
Source§impl From<JsValue> for RequestMediaKeySystemAccessNotification
impl From<JsValue> for RequestMediaKeySystemAccessNotification
Source§fn from(obj: JsValue) -> RequestMediaKeySystemAccessNotification
fn from(obj: JsValue) -> RequestMediaKeySystemAccessNotification
Source§impl From<JsValue> for ResponseInit
impl From<JsValue> for ResponseInit
Source§fn from(obj: JsValue) -> ResponseInit
fn from(obj: JsValue) -> ResponseInit
Source§impl From<JsValue> for RuntimeError
impl From<JsValue> for RuntimeError
Source§fn from(obj: JsValue) -> RuntimeError
fn from(obj: JsValue) -> RuntimeError
Source§fn from(obj: JsValue) -> SharedArrayBuffer
fn from(obj: JsValue) -> SharedArrayBuffer
Source§impl From<JsValue> for SyntaxError
impl From<JsValue> for SyntaxError
Source§fn from(obj: JsValue) -> SyntaxError
fn from(obj: JsValue) -> SyntaxError
Source§impl From<JsValue> for TouchEvent
impl From<JsValue> for TouchEvent
Source§fn from(obj: JsValue) -> TouchEvent
fn from(obj: JsValue) -> TouchEvent
Source§impl From<JsValue> for Uint16Array
impl From<JsValue> for Uint16Array
Source§fn from(obj: JsValue) -> Uint16Array
fn from(obj: JsValue) -> Uint16Array
Source§impl From<JsValue> for Uint32Array
impl From<JsValue> for Uint32Array
Source§fn from(obj: JsValue) -> Uint32Array
fn from(obj: JsValue) -> Uint32Array
Source§impl From<JsValue> for Uint8Array
impl From<JsValue> for Uint8Array
Source§fn from(obj: JsValue) -> Uint8Array
fn from(obj: JsValue) -> Uint8Array
Source§impl From<JsValue> for Uint8ClampedArray
impl From<JsValue> for Uint8ClampedArray
Source§fn from(obj: JsValue) -> Uint8ClampedArray
fn from(obj: JsValue) -> Uint8ClampedArray
Source§impl From<JsValue> for UrlSearchParams
impl From<JsValue> for UrlSearchParams
Source§fn from(obj: JsValue) -> UrlSearchParams
fn from(obj: JsValue) -> UrlSearchParams
Source§impl From<KeyboardEvent> for JsValue
impl From<KeyboardEvent> for JsValue
Source§fn from(obj: KeyboardEvent) -> JsValue
fn from(obj: KeyboardEvent) -> JsValue
Source§impl From<MediaQueryList> for JsValue
impl From<MediaQueryList> for JsValue
Source§fn from(obj: MediaQueryList) -> JsValue
fn from(obj: MediaQueryList) -> JsValue
Source§impl From<MediaQueryListEvent> for JsValue
impl From<MediaQueryListEvent> for JsValue
Source§fn from(obj: MediaQueryListEvent) -> JsValue
fn from(obj: MediaQueryListEvent) -> JsValue
Source§impl From<MouseEvent> for JsValue
impl From<MouseEvent> for JsValue
Source§fn from(obj: MouseEvent) -> JsValue
fn from(obj: MouseEvent) -> JsValue
Source§impl From<NumberFormat> for JsValue
impl From<NumberFormat> for JsValue
Source§fn from(obj: NumberFormat) -> JsValue
fn from(obj: NumberFormat) -> JsValue
Source§impl From<PluralRules> for JsValue
impl From<PluralRules> for JsValue
Source§fn from(obj: PluralRules) -> JsValue
fn from(obj: PluralRules) -> JsValue
Source§impl From<PointerEvent> for JsValue
impl From<PointerEvent> for JsValue
Source§fn from(obj: PointerEvent) -> JsValue
fn from(obj: PointerEvent) -> JsValue
Source§impl From<RangeError> for JsValue
impl From<RangeError> for JsValue
Source§fn from(obj: RangeError) -> JsValue
fn from(obj: RangeError) -> JsValue
Source§impl From<ReferenceError> for JsValue
impl From<ReferenceError> for JsValue
Source§fn from(obj: ReferenceError) -> JsValue
fn from(obj: ReferenceError) -> JsValue
Source§impl From<RelativeTimeFormat> for JsValue
impl From<RelativeTimeFormat> for JsValue
Source§fn from(obj: RelativeTimeFormat) -> JsValue
fn from(obj: RelativeTimeFormat) -> JsValue
Source§impl From<RequestCache> for JsValue
impl From<RequestCache> for JsValue
Source§fn from(val: RequestCache) -> JsValue
fn from(val: RequestCache) -> JsValue
Source§impl From<RequestCredentials> for JsValue
impl From<RequestCredentials> for JsValue
Source§fn from(val: RequestCredentials) -> JsValue
fn from(val: RequestCredentials) -> JsValue
Source§impl From<RequestDestination> for JsValue
impl From<RequestDestination> for JsValue
Source§fn from(val: RequestDestination) -> JsValue
fn from(val: RequestDestination) -> JsValue
Source§impl From<RequestInit> for JsValue
impl From<RequestInit> for JsValue
Source§fn from(obj: RequestInit) -> JsValue
fn from(obj: RequestInit) -> JsValue
Source§impl From<RequestMediaKeySystemAccessNotification> for JsValue
impl From<RequestMediaKeySystemAccessNotification> for JsValue
Source§fn from(obj: RequestMediaKeySystemAccessNotification) -> JsValue
fn from(obj: RequestMediaKeySystemAccessNotification) -> JsValue
Source§impl From<RequestMode> for JsValue
impl From<RequestMode> for JsValue
Source§fn from(val: RequestMode) -> JsValue
fn from(val: RequestMode) -> JsValue
Source§impl From<RequestRedirect> for JsValue
impl From<RequestRedirect> for JsValue
Source§fn from(val: RequestRedirect) -> JsValue
fn from(val: RequestRedirect) -> JsValue
Source§impl From<ResponseInit> for JsValue
impl From<ResponseInit> for JsValue
Source§fn from(obj: ResponseInit) -> JsValue
fn from(obj: ResponseInit) -> JsValue
Source§impl From<ResponseType> for JsValue
impl From<ResponseType> for JsValue
Source§fn from(val: ResponseType) -> JsValue
fn from(val: ResponseType) -> JsValue
Source§impl From<RuntimeError> for JsValue
impl From<RuntimeError> for JsValue
Source§fn from(obj: RuntimeError) -> JsValue
fn from(obj: RuntimeError) -> JsValue
Source§fn from(obj: SharedArrayBuffer) -> JsValue
fn from(obj: SharedArrayBuffer) -> JsValue
Source§impl From<SupportedType> for JsValue
impl From<SupportedType> for JsValue
Source§fn from(val: SupportedType) -> JsValue
fn from(val: SupportedType) -> JsValue
Source§impl From<SyntaxError> for JsValue
impl From<SyntaxError> for JsValue
Source§fn from(obj: SyntaxError) -> JsValue
fn from(obj: SyntaxError) -> JsValue
Source§impl From<TouchEvent> for JsValue
impl From<TouchEvent> for JsValue
Source§fn from(obj: TouchEvent) -> JsValue
fn from(obj: TouchEvent) -> JsValue
Source§impl From<Uint16Array> for JsValue
impl From<Uint16Array> for JsValue
Source§fn from(obj: Uint16Array) -> JsValue
fn from(obj: Uint16Array) -> JsValue
Source§impl From<Uint32Array> for JsValue
impl From<Uint32Array> for JsValue
Source§fn from(obj: Uint32Array) -> JsValue
fn from(obj: Uint32Array) -> JsValue
Source§impl From<Uint8Array> for JsValue
impl From<Uint8Array> for JsValue
Source§fn from(obj: Uint8Array) -> JsValue
fn from(obj: Uint8Array) -> JsValue
Source§impl From<Uint8ClampedArray> for JsValue
impl From<Uint8ClampedArray> for JsValue
Source§fn from(obj: Uint8ClampedArray) -> JsValue
fn from(obj: Uint8ClampedArray) -> JsValue
Source§impl From<UrlSearchParams> for JsValue
impl From<UrlSearchParams> for JsValue
Source§fn from(obj: UrlSearchParams) -> JsValue
fn from(obj: UrlSearchParams) -> JsValue
Source§impl FromWasmAbi for JsValue
impl FromWasmAbi for JsValue
Source§impl IntoWasmAbi for &JsValue
impl IntoWasmAbi for &JsValue
Source§impl IntoWasmAbi for JsValue
impl IntoWasmAbi for JsValue
Source§impl JsCast for JsValue
impl JsCast for JsValue
Source§fn instanceof(_val: &JsValue) -> bool
fn instanceof(_val: &JsValue) -> bool
instanceof check to see whether the JsValue
provided is an instance of this type. Read moreSource§fn unchecked_from_js(val: JsValue) -> JsValue
fn unchecked_from_js(val: JsValue) -> JsValue
Source§fn unchecked_from_js_ref(val: &JsValue) -> &JsValue
fn unchecked_from_js_ref(val: &JsValue) -> &JsValue
Source§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
T. Read moreSource§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
T. Read moreSource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Source§impl LongRefFromWasmAbi for JsValue
impl LongRefFromWasmAbi for JsValue
Source§impl PartialEq for JsValue
impl PartialEq for JsValue
Source§impl RefFromWasmAbi for JsValue
impl RefFromWasmAbi for JsValue
Source§type Anchor = ManuallyDrop<JsValue>
type Anchor = ManuallyDrop<JsValue>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(js: u32) -> <JsValue as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi(js: u32) -> <JsValue as RefFromWasmAbi>::Anchor
Source§impl VectorFromWasmAbi for JsValue
impl VectorFromWasmAbi for JsValue
Auto Trait Implementations§
impl Freeze for JsValue
impl RefUnwindSafe for JsValue
impl !Send for JsValue
impl !Sync for JsValue
impl Unpin for JsValue
impl UnsafeUnpin for JsValue
impl UnwindSafe for JsValue
Blanket Implementations§
Source§impl<T, R> AsStaticRef<R> for Twhere
T: AsRef<R>,
impl<T, R> AsStaticRef<R> for Twhere
T: AsRef<R>,
fn as_static_ref(&'static self) -> &'static R
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.