pub struct JsOption<T = JsValue> { /* private fields */ }Expand description
A nullable JS value of type T.
Unlike Option<T>, which is a Rust-side construct, JsOption<T> represents
a JS value that may be T, null, or undefined, where the null status is
not yet known in Rust. The value remains in JS until inspected via methods
like is_empty, as_option, or
into_option.
T must implement JsGeneric, meaning it is any type that can be
represented as a JsValue (e.g., JsString, Number, Object, etc.).
JsOption<T> itself implements JsGeneric, so it can be used in all
generic positions that accept JS types.
Implementations§
Source§impl<T> JsOption<T>
impl<T> JsOption<T>
Sourcepub fn from_option(opt: Option<T>) -> JsOption<T>
pub fn from_option(opt: Option<T>) -> JsOption<T>
Creates a JsOption<T> from an Option<T>.
Returns JsOption::wrap(val) if Some(val), otherwise JsOption::new().
Sourcepub fn as_option(&self) -> Option<T>
pub fn as_option(&self) -> Option<T>
Converts this JsOption<T> to an Option<T> by cloning the inner value.
Returns None if the value is null or undefined, otherwise returns
Some(T) with a clone of the contained value.
Sourcepub fn into_option(self) -> Option<T>
pub fn into_option(self) -> Option<T>
Converts this JsOption<T> into an Option<T>, consuming self.
Returns None if the value is null or undefined, otherwise returns
Some(T) with the contained value.
Sourcepub fn expect(self, msg: &str) -> T
pub fn expect(self, msg: &str) -> T
Returns the contained value, consuming self.
§Panics
Panics if the value is null or undefined, with a panic message
including the passed message.
Sourcepub fn unwrap_or_default(self) -> Twhere
T: Default,
pub fn unwrap_or_default(self) -> Twhere
T: Default,
Returns the contained value or a default.
Returns the contained value if not null or undefined, otherwise
returns the default value of T.
Sourcepub fn unwrap_or_else<F>(self, f: F) -> Twhere
F: FnOnce() -> T,
pub fn unwrap_or_else<F>(self, f: F) -> Twhere
F: FnOnce() -> T,
Returns the contained value or computes it from a closure.
Returns the contained value if not null or undefined, otherwise
calls f and returns the result.
Methods from Deref<Target = JsValue>§
pub const NULL: JsValue
pub const UNDEFINED: JsValue
pub const TRUE: JsValue
pub const FALSE: JsValue
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<T> ErasableGeneric for JsOption<T>
impl<T> ErasableGeneric for JsOption<T>
Source§impl<T> FromWasmAbi for JsOption<T>
impl<T> FromWasmAbi for JsOption<T>
Source§impl<'a, T> IntoWasmAbi for &'a JsOption<T>
impl<'a, T> IntoWasmAbi for &'a JsOption<T>
Source§impl<T> IntoWasmAbi for JsOption<T>
impl<T> IntoWasmAbi for JsOption<T>
Source§impl<T> JsCast for JsOption<T>
impl<T> JsCast for JsOption<T>
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) -> JsOption<T>
fn unchecked_from_js(val: JsValue) -> JsOption<T>
Source§fn unchecked_from_js_ref(val: &JsValue) -> &JsOption<T>
fn unchecked_from_js_ref(val: &JsValue) -> &JsOption<T>
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<T> LongRefFromWasmAbi for JsOption<T>
impl<T> LongRefFromWasmAbi for JsOption<T>
Source§unsafe fn long_ref_from_abi(
js: <JsOption<T> as LongRefFromWasmAbi>::Abi,
) -> <JsOption<T> as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <JsOption<T> as LongRefFromWasmAbi>::Abi, ) -> <JsOption<T> as LongRefFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abiSource§impl<T> OptionFromWasmAbi for JsOption<T>
impl<T> OptionFromWasmAbi for JsOption<T>
Source§impl<'a, T> OptionIntoWasmAbi for &'a JsOption<T>
impl<'a, T> OptionIntoWasmAbi for &'a JsOption<T>
Source§impl<T> OptionIntoWasmAbi for JsOption<T>
impl<T> OptionIntoWasmAbi for JsOption<T>
Source§impl<T> Promising for JsOption<T>
impl<T> Promising for JsOption<T>
Source§type Resolution = JsOption<T>
type Resolution = JsOption<T>
Source§impl<T> RefFromWasmAbi for JsOption<T>
impl<T> RefFromWasmAbi for JsOption<T>
Source§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = ManuallyDrop<JsOption<T>>
type Anchor = ManuallyDrop<JsOption<T>>
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: <JsOption<T> as RefFromWasmAbi>::Abi,
) -> <JsOption<T> as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <JsOption<T> as RefFromWasmAbi>::Abi, ) -> <JsOption<T> as RefFromWasmAbi>::Anchor
impl<T> StructuralPartialEq for JsOption<T>
impl<T> UpcastFrom<()> for JsOption<T>
impl<T1, Target1> UpcastFrom<(T1,)> for JsOption<(Target1,)>
impl<T1, T2, Target1, Target2> UpcastFrom<(T1, T2)> for JsOption<(Target1, Target2)>where
T1: JsGeneric,
T2: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
impl<T1, T2, T3, Target1, Target2, Target3> UpcastFrom<(T1, T2, T3)> for JsOption<(Target1, Target2, Target3)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
impl<T1, T2, T3, T4, Target1, Target2, Target3, Target4> UpcastFrom<(T1, T2, T3, T4)> for JsOption<(Target1, Target2, Target3, Target4)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
T4: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
Target4: JsGeneric + UpcastFrom<T4>,
impl<T1, T2, T3, T4, T5, Target1, Target2, Target3, Target4, Target5> UpcastFrom<(T1, T2, T3, T4, T5)> for JsOption<(Target1, Target2, Target3, Target4, Target5)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
T4: JsGeneric,
T5: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
Target4: JsGeneric + UpcastFrom<T4>,
Target5: JsGeneric + UpcastFrom<T5>,
impl<T1, T2, T3, T4, T5, T6, Target1, Target2, Target3, Target4, Target5, Target6> UpcastFrom<(T1, T2, T3, T4, T5, T6)> for JsOption<(Target1, Target2, Target3, Target4, Target5, Target6)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
T4: JsGeneric,
T5: JsGeneric,
T6: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
Target4: JsGeneric + UpcastFrom<T4>,
Target5: JsGeneric + UpcastFrom<T5>,
Target6: JsGeneric + UpcastFrom<T6>,
impl<T1, T2, T3, T4, T5, T6, T7, Target1, Target2, Target3, Target4, Target5, Target6, Target7> UpcastFrom<(T1, T2, T3, T4, T5, T6, T7)> for JsOption<(Target1, Target2, Target3, Target4, Target5, Target6, Target7)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
T4: JsGeneric,
T5: JsGeneric,
T6: JsGeneric,
T7: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
Target4: JsGeneric + UpcastFrom<T4>,
Target5: JsGeneric + UpcastFrom<T5>,
Target6: JsGeneric + UpcastFrom<T6>,
Target7: JsGeneric + UpcastFrom<T7>,
impl<T1, T2, T3, T4, T5, T6, T7, T8, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8> UpcastFrom<(T1, T2, T3, T4, T5, T6, T7, T8)> for JsOption<(Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8)>where
T1: JsGeneric,
T2: JsGeneric,
T3: JsGeneric,
T4: JsGeneric,
T5: JsGeneric,
T6: JsGeneric,
T7: JsGeneric,
T8: JsGeneric,
Target1: JsGeneric + UpcastFrom<T1>,
Target2: JsGeneric + UpcastFrom<T2>,
Target3: JsGeneric + UpcastFrom<T3>,
Target4: JsGeneric + UpcastFrom<T4>,
Target5: JsGeneric + UpcastFrom<T5>,
Target6: JsGeneric + UpcastFrom<T6>,
Target7: JsGeneric + UpcastFrom<T7>,
Target8: JsGeneric + UpcastFrom<T8>,
impl<T, Target> UpcastFrom<*const T> for JsOption<*const Target>where
Target: UpcastFrom<T>,
impl<T, __UpcastTarget0> UpcastFrom<Array<T>> for JsOption<Array<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<Array<T>> for JsOption<Object>
impl UpcastFrom<ArrayBuffer> for JsOption<ArrayBuffer>
impl UpcastFrom<ArrayBuffer> for JsOption<Object>
impl UpcastFrom<ArrayBufferOptions> for JsOption<ArrayBufferOptions>
impl UpcastFrom<ArrayBufferOptions> for JsOption<Object>
impl<T1, Target> UpcastFrom<ArrayTuple<(T1,)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1>,
impl<T1, T2, Target> UpcastFrom<ArrayTuple<(T1, T2)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1> + UpcastFrom<T2>,
impl<T1, T2, T3, Target> UpcastFrom<ArrayTuple<(T1, T2, T3)>> for JsOption<Array<Target>>
impl<T1, T2, T3, T4, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4)>> for JsOption<Array<Target>>
impl<T1, T2, T3, T4, T5, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4, T5)>> for JsOption<Array<Target>>
impl<T1, T2, T3, T4, T5, T6, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4, T5, T6)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1> + UpcastFrom<T2> + UpcastFrom<T3> + UpcastFrom<T4> + UpcastFrom<T5> + UpcastFrom<T6>,
impl<T1, T2, T3, T4, T5, T6, T7, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1> + UpcastFrom<T2> + UpcastFrom<T3> + UpcastFrom<T4> + UpcastFrom<T5> + UpcastFrom<T6> + UpcastFrom<T7>,
impl<T1, T2, T3, T4, T5, T6, T7, T8, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1> + UpcastFrom<T2> + UpcastFrom<T3> + UpcastFrom<T4> + UpcastFrom<T5> + UpcastFrom<T6> + UpcastFrom<T7> + UpcastFrom<T8>,
impl<T: JsTuple> UpcastFrom<ArrayTuple<T>> for JsOption<JsValue>
impl<T, __UpcastTarget0> UpcastFrom<AsyncGenerator<T>> for JsOption<AsyncGenerator<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<AsyncGenerator<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<AsyncIterator<T>> for JsOption<AsyncIterator<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl UpcastFrom<BigInt> for JsOption<BigInt>
impl UpcastFrom<BigInt> for JsOption<Object>
impl UpcastFrom<BigInt64Array> for JsOption<BigInt64Array>
impl UpcastFrom<BigInt64Array> for JsOption<Object>
impl UpcastFrom<BigUint64Array> for JsOption<BigUint64Array>
impl UpcastFrom<BigUint64Array> for JsOption<Object>
impl UpcastFrom<Boolean> for JsOption<Boolean>
impl UpcastFrom<Boolean> for JsOption<Object>
impl UpcastFrom<Collator> for JsOption<Collator>
impl UpcastFrom<Collator> for JsOption<Object>
impl UpcastFrom<CollatorOptions> for JsOption<CollatorOptions>
impl UpcastFrom<CollatorOptions> for JsOption<Object>
impl UpcastFrom<CompileError> for JsOption<CompileError>
impl UpcastFrom<CompileError> for JsOption<Error>
impl UpcastFrom<DataView> for JsOption<DataView>
impl UpcastFrom<DataView> for JsOption<Object>
impl UpcastFrom<Date> for JsOption<Date>
impl UpcastFrom<Date> for JsOption<Object>
impl UpcastFrom<DateTimeFormat> for JsOption<DateTimeFormat>
impl UpcastFrom<DateTimeFormat> for JsOption<Object>
impl UpcastFrom<DateTimeFormatOptions> for JsOption<DateTimeFormatOptions>
impl UpcastFrom<DateTimeFormatOptions> for JsOption<Object>
impl UpcastFrom<DateTimeFormatPart> for JsOption<DateTimeFormatPart>
impl UpcastFrom<DateTimeFormatPart> for JsOption<Object>
impl UpcastFrom<DateTimeRangeFormatPart> for JsOption<DateTimeFormatPart>
impl UpcastFrom<DateTimeRangeFormatPart> for JsOption<DateTimeRangeFormatPart>
impl UpcastFrom<DisplayNames> for JsOption<DisplayNames>
impl UpcastFrom<DisplayNames> for JsOption<Object>
impl UpcastFrom<DisplayNamesOptions> for JsOption<DisplayNamesOptions>
impl UpcastFrom<DisplayNamesOptions> for JsOption<Object>
impl UpcastFrom<Duration> for JsOption<Duration>
impl UpcastFrom<Duration> for JsOption<Object>
impl UpcastFrom<DurationFormat> for JsOption<DurationFormat>
impl UpcastFrom<DurationFormat> for JsOption<Object>
impl UpcastFrom<DurationFormatOptions> for JsOption<DurationFormatOptions>
impl UpcastFrom<DurationFormatOptions> for JsOption<Object>
impl UpcastFrom<DurationFormatPart> for JsOption<DurationFormatPart>
impl UpcastFrom<DurationFormatPart> for JsOption<Object>
impl UpcastFrom<Error> for JsOption<Error>
impl UpcastFrom<Error> for JsOption<Object>
impl UpcastFrom<EvalError> for JsOption<Error>
impl UpcastFrom<EvalError> for JsOption<EvalError>
impl UpcastFrom<EvalError> for JsOption<Object>
impl UpcastFrom<Exception> for JsOption<Exception>
impl UpcastFrom<Exception> for JsOption<Object>
impl UpcastFrom<Float32Array> for JsOption<Float32Array>
impl UpcastFrom<Float32Array> for JsOption<Object>
impl UpcastFrom<Float64Array> for JsOption<Float64Array>
impl UpcastFrom<Float64Array> for JsOption<Object>
impl<T: JsFunction> UpcastFrom<Function<T>> for JsOption<JsValue>
impl<T: JsFunction> UpcastFrom<Function<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<Generator<T>> for JsOption<Generator<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<Generator<T>> for JsOption<Object>
impl UpcastFrom<Global> for JsOption<Global>
impl UpcastFrom<Global> for JsOption<Object>
impl UpcastFrom<Instance> for JsOption<Instance>
impl UpcastFrom<Instance> for JsOption<Object>
impl UpcastFrom<Int16Array> for JsOption<Int16Array>
impl UpcastFrom<Int16Array> for JsOption<Object>
impl UpcastFrom<Int32Array> for JsOption<Int32Array>
impl UpcastFrom<Int32Array> for JsOption<Object>
impl UpcastFrom<Int8Array> for JsOption<Int8Array>
impl UpcastFrom<Int8Array> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<Iterator<T>> for JsOption<Iterator<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T, __UpcastTarget0> UpcastFrom<IteratorNext<T>> for JsOption<IteratorNext<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<IteratorNext<T>> for JsOption<Object>
impl UpcastFrom<JsClosure> for JsOption<JsClosure>
impl UpcastFrom<JsError> for JsOption
impl<T> UpcastFrom<JsOption<T>> for JsValue
impl<T, U> UpcastFrom<JsOption<U>> for JsOption<T>where
T: UpcastFrom<U>,
impl UpcastFrom<JsString> for JsOption<JsString>
impl UpcastFrom<JsString> for JsOption<Object>
impl UpcastFrom<JsValue> for JsOption
impl UpcastFrom<LinkError> for JsOption<Error>
impl UpcastFrom<LinkError> for JsOption<LinkError>
impl UpcastFrom<ListFormat> for JsOption<ListFormat>
impl UpcastFrom<ListFormat> for JsOption<Object>
impl UpcastFrom<ListFormatOptions> for JsOption<ListFormatOptions>
impl UpcastFrom<ListFormatOptions> for JsOption<Object>
impl UpcastFrom<ListFormatPart> for JsOption<ListFormatPart>
impl UpcastFrom<ListFormatPart> for JsOption<Object>
impl UpcastFrom<Locale> for JsOption<Locale>
impl UpcastFrom<Locale> for JsOption<Object>
impl UpcastFrom<LocaleMatcherOptions> for JsOption<LocaleMatcherOptions>
impl UpcastFrom<LocaleMatcherOptions> for JsOption<Object>
impl<K, V, __UpcastTarget0, __UpcastTarget1> UpcastFrom<Map<K, V>> for JsOption<Map<__UpcastTarget0, __UpcastTarget1>>where
__UpcastTarget0: UpcastFrom<K>,
__UpcastTarget1: UpcastFrom<V>,
impl<K, V> UpcastFrom<Map<K, V>> for JsOption<Object>
impl UpcastFrom<Memory> for JsOption<Memory>
impl UpcastFrom<Memory> for JsOption<Object>
impl UpcastFrom<Module> for JsOption<Module>
impl UpcastFrom<Module> for JsOption<Object>
impl<T> UpcastFrom<Null> for JsOption<T>
impl UpcastFrom<Number> for JsOption<Number>
impl UpcastFrom<Number> for JsOption<Object>
impl UpcastFrom<NumberFormat> for JsOption<NumberFormat>
impl UpcastFrom<NumberFormat> for JsOption<Object>
impl UpcastFrom<NumberFormatOptions> for JsOption<NumberFormatOptions>
impl UpcastFrom<NumberFormatOptions> for JsOption<Object>
impl UpcastFrom<NumberFormatPart> for JsOption<NumberFormatPart>
impl UpcastFrom<NumberFormatPart> for JsOption<Object>
impl UpcastFrom<NumberRangeFormatPart> for JsOption<NumberFormatPart>
impl UpcastFrom<NumberRangeFormatPart> for JsOption<NumberRangeFormatPart>
impl<T, __UpcastTarget0> UpcastFrom<Object<T>> for JsOption<Object<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T, Target> UpcastFrom<Option<T>> for JsOption<Option<Target>>where
Target: UpcastFrom<T>,
impl UpcastFrom<PluralRules> for JsOption<Object>
impl UpcastFrom<PluralRules> for JsOption<PluralRules>
impl UpcastFrom<PluralRulesOptions> for JsOption<Object>
impl UpcastFrom<PluralRulesOptions> for JsOption<PluralRulesOptions>
impl<T> UpcastFrom<Promise<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<Promise<T>> for JsOption<Promise<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<PromiseState<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<PromiseState<T>> for JsOption<PromiseState<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<PropertyDescriptor<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<PropertyDescriptor<T>> for JsOption<PropertyDescriptor<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl UpcastFrom<Proxy> for JsOption<Proxy>
impl UpcastFrom<RangeError> for JsOption<Error>
impl UpcastFrom<RangeError> for JsOption<Object>
impl UpcastFrom<RangeError> for JsOption<RangeError>
impl UpcastFrom<ReferenceError> for JsOption<Error>
impl UpcastFrom<ReferenceError> for JsOption<Object>
impl UpcastFrom<ReferenceError> for JsOption<ReferenceError>
impl UpcastFrom<RegExp> for JsOption<Object>
impl UpcastFrom<RegExp> for JsOption<RegExp>
impl UpcastFrom<RegExpMatchArray> for JsOption<Array>
impl UpcastFrom<RegExpMatchArray> for JsOption<Object>
impl UpcastFrom<RegExpMatchArray> for JsOption<RegExpMatchArray>
impl UpcastFrom<RelativeTimeFormat> for JsOption<Object>
impl UpcastFrom<RelativeTimeFormat> for JsOption<RelativeTimeFormat>
impl UpcastFrom<RelativeTimeFormatOptions> for JsOption<Object>
impl UpcastFrom<RelativeTimeFormatOptions> for JsOption<RelativeTimeFormatOptions>
impl UpcastFrom<RelativeTimeFormatPart> for JsOption<Object>
impl UpcastFrom<RelativeTimeFormatPart> for JsOption<RelativeTimeFormatPart>
impl UpcastFrom<ResolvedCollatorOptions> for JsOption<CollatorOptions>
impl UpcastFrom<ResolvedCollatorOptions> for JsOption<ResolvedCollatorOptions>
impl UpcastFrom<ResolvedDateTimeFormatOptions> for JsOption<DateTimeFormatOptions>
impl UpcastFrom<ResolvedDateTimeFormatOptions> for JsOption<ResolvedDateTimeFormatOptions>
impl UpcastFrom<ResolvedDisplayNamesOptions> for JsOption<DisplayNamesOptions>
impl UpcastFrom<ResolvedDisplayNamesOptions> for JsOption<ResolvedDisplayNamesOptions>
impl UpcastFrom<ResolvedDurationFormatOptions> for JsOption<DurationFormatOptions>
impl UpcastFrom<ResolvedDurationFormatOptions> for JsOption<ResolvedDurationFormatOptions>
impl UpcastFrom<ResolvedListFormatOptions> for JsOption<ListFormatOptions>
impl UpcastFrom<ResolvedListFormatOptions> for JsOption<ResolvedListFormatOptions>
impl UpcastFrom<ResolvedNumberFormatOptions> for JsOption<NumberFormatOptions>
impl UpcastFrom<ResolvedNumberFormatOptions> for JsOption<ResolvedNumberFormatOptions>
impl UpcastFrom<ResolvedPluralRulesOptions> for JsOption<PluralRulesOptions>
impl UpcastFrom<ResolvedPluralRulesOptions> for JsOption<ResolvedPluralRulesOptions>
impl UpcastFrom<ResolvedRelativeTimeFormatOptions> for JsOption<RelativeTimeFormatOptions>
impl UpcastFrom<ResolvedRelativeTimeFormatOptions> for JsOption<ResolvedRelativeTimeFormatOptions>
impl UpcastFrom<ResolvedSegmenterOptions> for JsOption<ResolvedSegmenterOptions>
impl UpcastFrom<ResolvedSegmenterOptions> for JsOption<SegmenterOptions>
impl<T, E, TargetT, TargetE> UpcastFrom<Result<T, E>> for JsOption<Result<TargetT, TargetE>>where
TargetT: UpcastFrom<T>,
TargetE: UpcastFrom<E>,
impl UpcastFrom<RuntimeError> for JsOption<Error>
impl UpcastFrom<RuntimeError> for JsOption<RuntimeError>
impl UpcastFrom<SegmentData> for JsOption<Object>
impl UpcastFrom<SegmentData> for JsOption<SegmentData>
impl UpcastFrom<Segmenter> for JsOption<Object>
impl UpcastFrom<Segmenter> for JsOption<Segmenter>
impl UpcastFrom<SegmenterOptions> for JsOption<Object>
impl UpcastFrom<SegmenterOptions> for JsOption<SegmenterOptions>
impl UpcastFrom<Segments> for JsOption<Object>
impl UpcastFrom<Segments> for JsOption<Segments>
impl<T> UpcastFrom<Set<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<Set<T>> for JsOption<Set<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl UpcastFrom<Symbol> for JsOption<Symbol>
impl UpcastFrom<SyntaxError> for JsOption<Error>
impl UpcastFrom<SyntaxError> for JsOption<Object>
impl UpcastFrom<SyntaxError> for JsOption<SyntaxError>
impl UpcastFrom<Table> for JsOption<Object>
impl UpcastFrom<Table> for JsOption<Table>
impl UpcastFrom<Tag> for JsOption<Object>
impl UpcastFrom<Tag> for JsOption<Tag>
impl UpcastFrom<TextInfo> for JsOption<Object>
impl UpcastFrom<TextInfo> for JsOption<TextInfo>
impl UpcastFrom<TypeError> for JsOption<Error>
impl UpcastFrom<TypeError> for JsOption<Object>
impl UpcastFrom<TypeError> for JsOption<TypeError>
impl UpcastFrom<Uint16Array> for JsOption<Object>
impl UpcastFrom<Uint16Array> for JsOption<Uint16Array>
impl UpcastFrom<Uint32Array> for JsOption<Object>
impl UpcastFrom<Uint32Array> for JsOption<Uint32Array>
impl UpcastFrom<Uint8Array> for JsOption<Object>
impl UpcastFrom<Uint8Array> for JsOption<Uint8Array>
impl UpcastFrom<Uint8ClampedArray> for JsOption<Object>
impl UpcastFrom<Uint8ClampedArray> for JsOption<Uint8ClampedArray>
impl<T> UpcastFrom<Undefined> for JsOption<T>
impl UpcastFrom<UriError> for JsOption<Error>
impl UpcastFrom<UriError> for JsOption<Object>
impl UpcastFrom<UriError> for JsOption<UriError>
impl<K, V> UpcastFrom<WeakMap<K, V>> for JsOption<Object>
impl<K, V, __UpcastTarget0, __UpcastTarget1> UpcastFrom<WeakMap<K, V>> for JsOption<WeakMap<__UpcastTarget0, __UpcastTarget1>>where
__UpcastTarget0: UpcastFrom<K>,
__UpcastTarget1: UpcastFrom<V>,
impl<T> UpcastFrom<WeakRef<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<WeakRef<T>> for JsOption<WeakRef<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<WeakSet<T>> for JsOption<Object>
impl<T, __UpcastTarget0> UpcastFrom<WeakSet<T>> for JsOption<WeakSet<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl UpcastFrom<WeekInfo> for JsOption<Object>
impl UpcastFrom<WeekInfo> for JsOption<WeekInfo>
impl UpcastFrom<bool> for JsOption
impl UpcastFrom<char> for JsOption
impl UpcastFrom<f32> for JsOption
impl UpcastFrom<f32> for JsOption<f64>
impl UpcastFrom<f64> for JsOption
impl UpcastFrom<i128> for JsOption
impl UpcastFrom<i16> for JsOption
impl UpcastFrom<i16> for JsOption<i128>
impl UpcastFrom<i16> for JsOption<i32>
impl UpcastFrom<i16> for JsOption<i64>
impl UpcastFrom<i32> for JsOption
impl UpcastFrom<i32> for JsOption<i128>
impl UpcastFrom<i32> for JsOption<i64>
impl UpcastFrom<i32> for JsOption<isize>
impl UpcastFrom<i64> for JsOption
impl UpcastFrom<i64> for JsOption<i128>
impl UpcastFrom<i8> for JsOption
impl UpcastFrom<i8> for JsOption<i128>
impl UpcastFrom<i8> for JsOption<i16>
impl UpcastFrom<i8> for JsOption<i32>
impl UpcastFrom<i8> for JsOption<i64>
impl UpcastFrom<isize> for JsOption
impl UpcastFrom<isize> for JsOption<i128>
impl UpcastFrom<isize> for JsOption<i32>
impl UpcastFrom<isize> for JsOption<i64>
impl UpcastFrom<u128> for JsOption
impl UpcastFrom<u16> for JsOption
impl UpcastFrom<u16> for JsOption<u128>
impl UpcastFrom<u16> for JsOption<u32>
impl UpcastFrom<u16> for JsOption<u64>
impl UpcastFrom<u32> for JsOption
impl UpcastFrom<u32> for JsOption<u128>
impl UpcastFrom<u32> for JsOption<u64>
impl UpcastFrom<u32> for JsOption<usize>
impl UpcastFrom<u64> for JsOption
impl UpcastFrom<u64> for JsOption<u128>
impl UpcastFrom<u8> for JsOption
impl UpcastFrom<u8> for JsOption<u128>
impl UpcastFrom<u8> for JsOption<u16>
impl UpcastFrom<u8> for JsOption<u32>
impl UpcastFrom<u8> for JsOption<u64>
impl UpcastFrom<usize> for JsOption
impl UpcastFrom<usize> for JsOption<u128>
impl UpcastFrom<usize> for JsOption<u32>
impl UpcastFrom<usize> for JsOption<u64>
Auto Trait Implementations§
impl<T> Freeze for JsOption<T>
impl<T> RefUnwindSafe for JsOption<T>where
T: RefUnwindSafe,
impl<T> Send for JsOption<T>where
T: Send,
impl<T> Sync for JsOption<T>where
T: Sync,
impl<T> Unpin for JsOption<T>where
T: Unpin,
impl<T> UnsafeUnpin for JsOption<T>
impl<T> UnwindSafe for JsOption<T>where
T: UnwindSafe,
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> 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.