pub struct ArrayTuple<T: JsTuple = (JsValue,)> { /* private fields */ }Implementations§
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new1<T1>(t1: &T1) -> ArrayTuple<(T1,)>where
T1: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1,)>: ErasableGenericOwn<ArrayTuple<(JsValue,)>>,
pub fn new1<T1>(t1: &T1) -> ArrayTuple<(T1,)>where
T1: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1,)>: ErasableGenericOwn<ArrayTuple<(JsValue,)>>,
Creates a new JS array typed as a 1-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new2<T1, T2>(t1: &T1, t2: &T2) -> ArrayTuple<(T1, T2)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue)>>,
pub fn new2<T1, T2>(t1: &T1, t2: &T2) -> ArrayTuple<(T1, T2)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue)>>,
Creates a new JS array typed as a 2-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new3<T1, T2, T3>(t1: &T1, t2: &T2, t3: &T3) -> ArrayTuple<(T1, T2, T3)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue)>>,
pub fn new3<T1, T2, T3>(t1: &T1, t2: &T2, t3: &T3) -> ArrayTuple<(T1, T2, T3)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 3-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new4<T1, T2, T3, T4>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
) -> ArrayTuple<(T1, T2, T3, T4)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue)>>,
pub fn new4<T1, T2, T3, T4>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
) -> ArrayTuple<(T1, T2, T3, T4)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 4-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new5<T1, T2, T3, T4, T5>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
) -> ArrayTuple<(T1, T2, T3, T4, T5)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue)>>,
pub fn new5<T1, T2, T3, T4, T5>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
) -> ArrayTuple<(T1, T2, T3, T4, T5)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 5-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new6<T1, T2, T3, T4, T5, T6>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
pub fn new6<T1, T2, T3, T4, T5, T6>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 6-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new7<T1, T2, T3, T4, T5, T6, T7>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
t7: &T7,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
T7: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
pub fn new7<T1, T2, T3, T4, T5, T6, T7>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
t7: &T7,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
T7: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 7-tuple.
Source§impl ArrayTuple
impl ArrayTuple
Sourcepub fn new8<T1, T2, T3, T4, T5, T6, T7, T8>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
t7: &T7,
t8: &T8,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
T7: ErasableGenericBorrow<JsValue>,
T8: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
pub fn new8<T1, T2, T3, T4, T5, T6, T7, T8>(
t1: &T1,
t2: &T2,
t3: &T3,
t4: &T4,
t5: &T5,
t6: &T6,
t7: &T7,
t8: &T8,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ErasableGenericBorrow<JsValue>,
T2: ErasableGenericBorrow<JsValue>,
T3: ErasableGenericBorrow<JsValue>,
T4: ErasableGenericBorrow<JsValue>,
T5: ErasableGenericBorrow<JsValue>,
T6: ErasableGenericBorrow<JsValue>,
T7: ErasableGenericBorrow<JsValue>,
T8: ErasableGenericBorrow<JsValue>,
ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>: ErasableGenericOwn<ArrayTuple<(JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue, JsValue)>>,
Creates a new JS array typed as a 8-tuple.
Source§impl<T> ArrayTuple<T>where
T: JsTuple1,
impl<T> ArrayTuple<T>where
T: JsTuple1,
Source§impl<T> ArrayTuple<T>where
T: JsTuple2,
impl<T> ArrayTuple<T>where
T: JsTuple2,
Source§impl<T> ArrayTuple<T>where
T: JsTuple3,
impl<T> ArrayTuple<T>where
T: JsTuple3,
Source§impl<T> ArrayTuple<T>where
T: JsTuple4,
impl<T> ArrayTuple<T>where
T: JsTuple4,
Source§impl<T> ArrayTuple<T>where
T: JsTuple5,
impl<T> ArrayTuple<T>where
T: JsTuple5,
Source§impl<T> ArrayTuple<T>where
T: JsTuple6,
impl<T> ArrayTuple<T>where
T: JsTuple6,
Source§impl<T> ArrayTuple<T>where
T: JsTuple7,
impl<T> ArrayTuple<T>where
T: JsTuple7,
Source§impl<T> ArrayTuple<T>where
T: JsTuple8,
impl<T> ArrayTuple<T>where
T: JsTuple8,
Source§impl<T> ArrayTuple<T>where
T: JsTuple1,
impl<T> ArrayTuple<T>where
T: JsTuple1,
Source§impl<T> ArrayTuple<T>where
T: JsTuple2,
impl<T> ArrayTuple<T>where
T: JsTuple2,
Source§impl<T> ArrayTuple<T>where
T: JsTuple3,
impl<T> ArrayTuple<T>where
T: JsTuple3,
Source§impl<T> ArrayTuple<T>where
T: JsTuple4,
impl<T> ArrayTuple<T>where
T: JsTuple4,
Source§impl<T> ArrayTuple<T>where
T: JsTuple5,
impl<T> ArrayTuple<T>where
T: JsTuple5,
Source§impl<T> ArrayTuple<T>where
T: JsTuple6,
impl<T> ArrayTuple<T>where
T: JsTuple6,
Source§impl<T> ArrayTuple<T>where
T: JsTuple7,
impl<T> ArrayTuple<T>where
T: JsTuple7,
Source§impl<T> ArrayTuple<T>where
T: JsTuple8,
impl<T> ArrayTuple<T>where
T: JsTuple8,
Source§impl<T: JsTuple> ArrayTuple<T>
impl<T: JsTuple> ArrayTuple<T>
Source§impl<T1: JsGeneric> ArrayTuple<(T1,)>
impl<T1: JsGeneric> ArrayTuple<(T1,)>
Sourcepub fn into_parts(self) -> (T1,)
pub fn into_parts(self) -> (T1,)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(get0: &T1) -> ArrayTuple<(T1,)>
pub fn new(get0: &T1) -> ArrayTuple<(T1,)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric> ArrayTuple<(T1, T2)>
impl<T1: JsGeneric, T2: JsGeneric> ArrayTuple<(T1, T2)>
Sourcepub fn into_parts(self) -> (T1, T2)
pub fn into_parts(self) -> (T1, T2)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(get0: &T1, get1: &T2) -> ArrayTuple<(T1, T2)>
pub fn new(get0: &T1, get1: &T2) -> ArrayTuple<(T1, T2)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric> ArrayTuple<(T1, T2, T3)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric> ArrayTuple<(T1, T2, T3)>
Sourcepub fn into_parts(self) -> (T1, T2, T3)
pub fn into_parts(self) -> (T1, T2, T3)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(get0: &T1, get1: &T2, get2: &T3) -> ArrayTuple<(T1, T2, T3)>
pub fn new(get0: &T1, get1: &T2, get2: &T3) -> ArrayTuple<(T1, T2, T3)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric> ArrayTuple<(T1, T2, T3, T4)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric> ArrayTuple<(T1, T2, T3, T4)>
Sourcepub fn into_parts(self) -> (T1, T2, T3, T4)
pub fn into_parts(self) -> (T1, T2, T3, T4)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(
get0: &T1,
get1: &T2,
get2: &T3,
get3: &T4,
) -> ArrayTuple<(T1, T2, T3, T4)>
pub fn new( get0: &T1, get1: &T2, get2: &T3, get3: &T4, ) -> ArrayTuple<(T1, T2, T3, T4)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5)>
Sourcepub fn into_parts(self) -> (T1, T2, T3, T4, T5)
pub fn into_parts(self) -> (T1, T2, T3, T4, T5)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(
get0: &T1,
get1: &T2,
get2: &T3,
get3: &T4,
get4: &T5,
) -> ArrayTuple<(T1, T2, T3, T4, T5)>
pub fn new( get0: &T1, get1: &T2, get2: &T3, get3: &T4, get4: &T5, ) -> ArrayTuple<(T1, T2, T3, T4, T5)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6)>
Sourcepub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6)
pub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(
get0: &T1,
get1: &T2,
get2: &T3,
get3: &T4,
get4: &T5,
get5: &T6,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6)>
pub fn new( get0: &T1, get1: &T2, get2: &T3, get3: &T4, get4: &T5, get5: &T6, ) -> ArrayTuple<(T1, T2, T3, T4, T5, T6)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
Sourcepub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6, T7)
pub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6, T7)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(
get0: &T1,
get1: &T2,
get2: &T3,
get3: &T4,
get4: &T5,
get5: &T6,
get6: &T7,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
pub fn new( get0: &T1, get1: &T2, get2: &T3, get3: &T4, get4: &T5, get5: &T6, get6: &T7, ) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric, T8: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric, T8: JsGeneric> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
Sourcepub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6, T7, T8)
pub fn into_parts(self) -> (T1, T2, T3, T4, T5, T6, T7, T8)
Convert the ArrayTuple into its corresponding Rust tuple
Sourcepub fn new(
get0: &T1,
get1: &T2,
get2: &T3,
get3: &T4,
get4: &T5,
get5: &T6,
get6: &T7,
get7: &T8,
) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
pub fn new( get0: &T1, get1: &T2, get2: &T3, get3: &T4, get4: &T5, get5: &T6, get6: &T7, get7: &T8, ) -> ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
Create a new ArrayTuple from the corresponding parts.
§Example
use js_sys::{ArrayTuple, JsString};
let tuple = ArrayTuple::<JsString, JsString>::new(&"a".into(), &"b".into());Note: You must specify the T using ::<...> syntax on ArrayTuple.
Alternatively, use new1, new2, etc. for type inference from the left-hand side.
Methods from Deref<Target = Object>§
Sourcepub fn constructor(&self) -> Function
pub fn constructor(&self) -> Function
The constructor property returns a reference to the Object constructor
function that created the instance object.
Sourcepub fn has_own_property(&self, property: &JsValue) -> bool
👎Deprecated: Use Object::hasOwn instead.
pub fn has_own_property(&self, property: &JsValue) -> bool
Object::hasOwn instead.The hasOwnProperty() method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
Sourcepub fn is_prototype_of(&self, value: &JsValue) -> bool
pub fn is_prototype_of(&self, value: &JsValue) -> bool
The isPrototypeOf() method checks if an object exists in another
object’s prototype chain.
Sourcepub fn property_is_enumerable(&self, property: &JsValue) -> bool
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
The propertyIsEnumerable() method returns a Boolean indicating
whether the specified property is enumerable.
Sourcepub fn to_locale_string(&self) -> JsString
pub fn to_locale_string(&self) -> JsString
The toLocaleString() method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
Sourcepub fn to_string(&self) -> JsString
pub fn to_string(&self) -> JsString
The toString() method returns a string representing the object.
Sourcepub fn to_js_string(&self) -> JsString
pub fn to_js_string(&self) -> JsString
The toString() method returns a string representing the object.
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: JsTuple> AsRef<ArrayTuple<T>> for ArrayTuple<T>
impl<T: JsTuple> AsRef<ArrayTuple<T>> for ArrayTuple<T>
Source§fn as_ref(&self) -> &ArrayTuple<T>
fn as_ref(&self) -> &ArrayTuple<T>
Source§impl<T: Clone + JsTuple> Clone for ArrayTuple<T>
impl<T: Clone + JsTuple> Clone for ArrayTuple<T>
Source§fn clone(&self) -> ArrayTuple<T>
fn clone(&self) -> ArrayTuple<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3)>
Source§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4)>
Source§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5)>
Source§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6)>
Source§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default, T7: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default, T7: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
Source§impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default, T7: JsGeneric + Default, T8: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
impl<T1: JsGeneric + Default, T2: JsGeneric + Default, T3: JsGeneric + Default, T4: JsGeneric + Default, T5: JsGeneric + Default, T6: JsGeneric + Default, T7: JsGeneric + Default, T8: JsGeneric + Default> Default for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
Source§impl<T: JsTuple> Deref for ArrayTuple<T>
impl<T: JsTuple> Deref for ArrayTuple<T>
Source§impl<T: JsTuple> ErasableGeneric for ArrayTuple<T>
impl<T: JsTuple> ErasableGeneric for ArrayTuple<T>
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric> From<(T1, T2, T3)> for ArrayTuple<(T1, T2, T3)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric> From<(T1, T2, T3)> for ArrayTuple<(T1, T2, T3)>
Source§fn from((get0, get1, get2): (T1, T2, T3)) -> Self
fn from((get0, get1, get2): (T1, T2, T3)) -> Self
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric> From<(T1, T2, T3, T4)> for ArrayTuple<(T1, T2, T3, T4)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric> From<(T1, T2, T3, T4)> for ArrayTuple<(T1, T2, T3, T4)>
Source§fn from((get0, get1, get2, get3): (T1, T2, T3, T4)) -> Self
fn from((get0, get1, get2, get3): (T1, T2, T3, T4)) -> Self
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric> From<(T1, T2, T3, T4, T5)> for ArrayTuple<(T1, T2, T3, T4, T5)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric> From<(T1, T2, T3, T4, T5)> for ArrayTuple<(T1, T2, T3, T4, T5)>
Source§fn from((get0, get1, get2, get3, get4): (T1, T2, T3, T4, T5)) -> Self
fn from((get0, get1, get2, get3, get4): (T1, T2, T3, T4, T5)) -> Self
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric> From<(T1, T2, T3, T4, T5, T6)> for ArrayTuple<(T1, T2, T3, T4, T5, T6)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric> From<(T1, T2, T3, T4, T5, T6)> for ArrayTuple<(T1, T2, T3, T4, T5, T6)>
Source§fn from((get0, get1, get2, get3, get4, get5): (T1, T2, T3, T4, T5, T6)) -> Self
fn from((get0, get1, get2, get3, get4, get5): (T1, T2, T3, T4, T5, T6)) -> Self
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric> From<(T1, T2, T3, T4, T5, T6, T7)> for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric> From<(T1, T2, T3, T4, T5, T6, T7)> for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7)>
Source§fn from(
(get0, get1, get2, get3, get4, get5, get6): (T1, T2, T3, T4, T5, T6, T7),
) -> Self
fn from( (get0, get1, get2, get3, get4, get5, get6): (T1, T2, T3, T4, T5, T6, T7), ) -> Self
Source§impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric, T8: JsGeneric> From<(T1, T2, T3, T4, T5, T6, T7, T8)> for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
impl<T1: JsGeneric, T2: JsGeneric, T3: JsGeneric, T4: JsGeneric, T5: JsGeneric, T6: JsGeneric, T7: JsGeneric, T8: JsGeneric> From<(T1, T2, T3, T4, T5, T6, T7, T8)> for ArrayTuple<(T1, T2, T3, T4, T5, T6, T7, T8)>
Source§fn from(
(get0, get1, get2, get3, get4, get5, get6, get7): (T1, T2, T3, T4, T5, T6, T7, T8),
) -> Self
fn from( (get0, get1, get2, get3, get4, get5, get6, get7): (T1, T2, T3, T4, T5, T6, T7, T8), ) -> Self
Source§impl<T: JsTuple> From<ArrayTuple<T>> for JsValue
impl<T: JsTuple> From<ArrayTuple<T>> for JsValue
Source§fn from(obj: ArrayTuple<T>) -> JsValue
fn from(obj: ArrayTuple<T>) -> JsValue
Source§impl<T: JsTuple> From<ArrayTuple<T>> for Object
impl<T: JsTuple> From<ArrayTuple<T>> for Object
Source§fn from(obj: ArrayTuple<T>) -> Object
fn from(obj: ArrayTuple<T>) -> Object
Source§impl From<JsValue> for ArrayTuple
impl From<JsValue> for ArrayTuple
Source§impl<T: JsTuple> FromWasmAbi for ArrayTuple<T>
impl<T: JsTuple> FromWasmAbi for ArrayTuple<T>
Source§impl<'a, T: JsTuple> IntoWasmAbi for &'a ArrayTuple<T>
impl<'a, T: JsTuple> IntoWasmAbi for &'a ArrayTuple<T>
Source§impl<T: JsTuple> IntoWasmAbi for ArrayTuple<T>
impl<T: JsTuple> IntoWasmAbi for ArrayTuple<T>
Source§impl<T: JsTuple> Iterable for ArrayTuple<T>
impl<T: JsTuple> Iterable for ArrayTuple<T>
Source§impl<T: JsTuple> JsCast for ArrayTuple<T>
impl<T: JsTuple> JsCast for ArrayTuple<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 is_type_of(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
JsValue provided
is a value of this type. Read moreSource§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
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§impl<T: JsTuple> LongRefFromWasmAbi for ArrayTuple<T>
impl<T: JsTuple> LongRefFromWasmAbi for ArrayTuple<T>
Source§type Anchor = ArrayTuple<T>
type Anchor = ArrayTuple<T>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl<T: JsTuple> OptionFromWasmAbi for ArrayTuple<T>
impl<T: JsTuple> OptionFromWasmAbi for ArrayTuple<T>
Source§impl<'a, T: JsTuple> OptionIntoWasmAbi for &'a ArrayTuple<T>
impl<'a, T: JsTuple> OptionIntoWasmAbi for &'a ArrayTuple<T>
Source§impl<T: JsTuple> OptionIntoWasmAbi for ArrayTuple<T>
impl<T: JsTuple> OptionIntoWasmAbi for ArrayTuple<T>
Source§impl<T: JsTuple> Promising for ArrayTuple<T>
impl<T: JsTuple> Promising for ArrayTuple<T>
Source§type Resolution = ArrayTuple<T>
type Resolution = ArrayTuple<T>
Source§impl<T: JsTuple> RefFromWasmAbi for ArrayTuple<T>
impl<T: JsTuple> RefFromWasmAbi for ArrayTuple<T>
Source§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = ManuallyDrop<ArrayTuple<T>>
type Anchor = ManuallyDrop<ArrayTuple<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.impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>,)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T: JsGeneric> UpcastFrom<Array<T>> for ArrayTuple<(JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>, JsOption<T>)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T,)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T, T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T, T, T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T, T, T, T, T)>
impl<T> UpcastFrom<Array<T>> for ArrayTuple<(T, T, T, T, T, T, T, T)>
impl<T1, Target> UpcastFrom<ArrayTuple<(T1,)>> for Array<Target>where
Target: UpcastFrom<T1>,
impl<T1, Target> UpcastFrom<ArrayTuple<(T1,)>> for JsOption<Array<Target>>where
Target: UpcastFrom<T1>,
impl<T1, T2, Target> UpcastFrom<ArrayTuple<(T1, T2)>> for Array<Target>where
Target: UpcastFrom<T1> + UpcastFrom<T2>,
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 Array<Target>
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 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 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 Array<Target>where
Target: UpcastFrom<T1> + UpcastFrom<T2> + UpcastFrom<T3> + UpcastFrom<T4> + UpcastFrom<T5> + UpcastFrom<T6>,
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 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, 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 Array<Target>where
Target: UpcastFrom<T1> + UpcastFrom<T2> + UpcastFrom<T3> + UpcastFrom<T4> + UpcastFrom<T5> + UpcastFrom<T6> + UpcastFrom<T7> + UpcastFrom<T8>,
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, U> UpcastFrom<ArrayTuple<T>> for ArrayTuple<U>where
U: UpcastFrom<T> + JsTuple,
impl<T: JsTuple> UpcastFrom<ArrayTuple<T>> for JsOption<JsValue>
impl<T: JsTuple> UpcastFrom<ArrayTuple<T>> for JsValue
Auto Trait Implementations§
impl<T> Freeze for ArrayTuple<T>
impl<T> RefUnwindSafe for ArrayTuple<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayTuple<T>where
T: Send,
impl<T> Sync for ArrayTuple<T>where
T: Sync,
impl<T> Unpin for ArrayTuple<T>where
T: Unpin,
impl<T> UnsafeUnpin for ArrayTuple<T>
impl<T> UnwindSafe for ArrayTuple<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.