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 from_serde<T>(t: &T) -> Result<JsValue, Error>
👎Deprecated: causes dependency cycles, use serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt instead
pub fn from_serde<T>(t: &T) -> Result<JsValue, Error>
serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt insteadCreates a new JsValue from the JSON serialization of the object t
provided.
This function is deprecated, due to creating a dependency cycle in
some circumstances. Use serde-wasm-bindgen or
gloo_utils::format::JsValueSerdeExt instead.
This function will serialize the provided value t to a JSON string,
send the JSON string to JS, parse it into a JS object, and then return
a handle to the JS object. This is unlikely to be super speedy so it’s
not recommended for large payloads, but it’s a nice to have in some
situations!
Usage of this API requires activating the serde-serialize feature of
the wasm-bindgen crate.
§Errors
Returns any error encountered when serializing T into JSON.
Sourcepub fn into_serde<T>(&self) -> Result<T, Error>where
T: for<'a> Deserialize<'a>,
👎Deprecated: causes dependency cycles, use serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt instead
pub fn into_serde<T>(&self) -> Result<T, Error>where
T: for<'a> Deserialize<'a>,
serde-wasm-bindgen or gloo_utils::format::JsValueSerdeExt insteadInvokes JSON.stringify on this value and then parses the resulting
JSON into an arbitrary Rust value.
This function is deprecated, due to creating a dependency cycle in
some circumstances. Use serde-wasm-bindgen or
gloo_utils::format::JsValueSerdeExt instead.
This function will first call JSON.stringify on the JsValue itself.
The resulting string is then passed into Rust which then parses it as
JSON into the resulting value.
Usage of this API requires activating the serde-serialize feature of
the wasm-bindgen crate.
§Errors
Returns any error encountered when parsing the JSON into a T.
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_null_or_undefined(&self) -> bool
pub fn is_null_or_undefined(&self) -> bool
Tests whether this JS value is null or 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 CanvasGradient
impl AsRef<JsValue> for CanvasGradient
Source§impl AsRef<JsValue> for CanvasRenderingContext2d
impl AsRef<JsValue> for CanvasRenderingContext2d
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 DomMatrixReadOnly
impl AsRef<JsValue> for DomMatrixReadOnly
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 HtmlCanvasElement
impl AsRef<JsValue> for HtmlCanvasElement
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 ImageBitmap
impl AsRef<JsValue> for ImageBitmap
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 NumberFormat
impl AsRef<JsValue> for NumberFormat
Source§impl AsRef<JsValue> for PluralRules
impl AsRef<JsValue> for PluralRules
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 RuntimeError
impl AsRef<JsValue> for RuntimeError
Source§impl AsRef<JsValue> for SyntaxError
impl AsRef<JsValue> for SyntaxError
Source§impl AsRef<JsValue> for TextMetrics
impl AsRef<JsValue> for TextMetrics
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 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<CanvasGradient> for JsValue
impl From<CanvasGradient> for JsValue
Source§fn from(obj: CanvasGradient) -> JsValue
fn from(obj: CanvasGradient) -> JsValue
Source§impl From<CanvasRenderingContext2d> for JsValue
impl From<CanvasRenderingContext2d> for JsValue
Source§fn from(obj: CanvasRenderingContext2d) -> JsValue
fn from(obj: CanvasRenderingContext2d) -> JsValue
Source§impl From<CanvasWindingRule> for JsValue
impl From<CanvasWindingRule> for JsValue
Source§fn from(val: CanvasWindingRule) -> JsValue
fn from(val: CanvasWindingRule) -> 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<DomMatrixReadOnly> for JsValue
impl From<DomMatrixReadOnly> for JsValue
Source§fn from(obj: DomMatrixReadOnly) -> JsValue
fn from(obj: DomMatrixReadOnly) -> 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<HtmlCanvasElement> for JsValue
impl From<HtmlCanvasElement> for JsValue
Source§fn from(obj: HtmlCanvasElement) -> JsValue
fn from(obj: HtmlCanvasElement) -> 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<ImageBitmap> for JsValue
impl From<ImageBitmap> for JsValue
Source§fn from(obj: ImageBitmap) -> JsValue
fn from(obj: ImageBitmap) -> 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<InterruptResult> for JsValue
impl From<InterruptResult> for JsValue
Source§fn from(value: InterruptResult) -> JsValue
fn from(value: InterruptResult) -> 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 CanvasGradient
impl From<JsValue> for CanvasGradient
Source§fn from(obj: JsValue) -> CanvasGradient
fn from(obj: JsValue) -> CanvasGradient
Source§impl From<JsValue> for CanvasRenderingContext2d
impl From<JsValue> for CanvasRenderingContext2d
Source§fn from(obj: JsValue) -> CanvasRenderingContext2d
fn from(obj: JsValue) -> CanvasRenderingContext2d
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 DomMatrixReadOnly
impl From<JsValue> for DomMatrixReadOnly
Source§fn from(obj: JsValue) -> DomMatrixReadOnly
fn from(obj: JsValue) -> DomMatrixReadOnly
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 HtmlCanvasElement
impl From<JsValue> for HtmlCanvasElement
Source§fn from(obj: JsValue) -> HtmlCanvasElement
fn from(obj: JsValue) -> HtmlCanvasElement
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 ImageBitmap
impl From<JsValue> for ImageBitmap
Source§fn from(obj: JsValue) -> ImageBitmap
fn from(obj: JsValue) -> ImageBitmap
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 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 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 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 TextMetrics
impl From<JsValue> for TextMetrics
Source§fn from(obj: JsValue) -> TextMetrics
fn from(obj: JsValue) -> TextMetrics
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<MemorySlice> for JsValue
impl From<MemorySlice> for JsValue
Source§fn from(value: MemorySlice) -> JsValue
fn from(value: MemorySlice) -> 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<PaxChassisWeb> for JsValue
impl From<PaxChassisWeb> for JsValue
Source§fn from(value: PaxChassisWeb) -> JsValue
fn from(value: PaxChassisWeb) -> 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<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<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<SyntaxError> for JsValue
impl From<SyntaxError> for JsValue
Source§fn from(obj: SyntaxError) -> JsValue
fn from(obj: SyntaxError) -> JsValue
Source§impl From<TextMetrics> for JsValue
impl From<TextMetrics> for JsValue
Source§fn from(obj: TextMetrics) -> JsValue
fn from(obj: TextMetrics) -> 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 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 OptionFromWasmAbi for JsValue
impl OptionFromWasmAbi for JsValue
Source§impl OptionIntoWasmAbi for JsValue
impl OptionIntoWasmAbi 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
Auto Trait Implementations§
impl Freeze for JsValue
impl RefUnwindSafe for JsValue
impl !Send for JsValue
impl !Sync for JsValue
impl Unpin for JsValue
impl UnwindSafe for JsValue
Blanket Implementations§
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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
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.