pub struct Array<T = JsValue> { /* private fields */ }Implementations§
Source§impl Array
impl Array
Sourcepub fn new_with_length(len: u32) -> Array
pub fn new_with_length(len: u32) -> Array
Creates a new array with the specified length (elements are initialized to undefined).
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn new_with_length_typed(len: u32) -> Array<T>
pub fn new_with_length_typed(len: u32) -> Array<T>
Creates a new array with the specified length (elements are initialized to undefined).
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn get_unchecked(&self, index: u32) -> Twhere
T: ErasableGenericOwn<JsValue>,
pub fn get_unchecked(&self, index: u32) -> Twhere
T: ErasableGenericOwn<JsValue>,
Retrieves the element at the index (returns undefined if the index is out of range).
Source§impl Array
impl Array
Source§impl Array
impl Array
Source§impl Array
impl Array
Sourcepub fn from_iterable_map<'a, I, U>(
val: &I,
map: &ImmediateClosure<'a, dyn FnMut(I::Item, u32) -> Result<U, JsError> + 'a>,
) -> Result<Array<U>, JsValue>
pub fn from_iterable_map<'a, I, U>( val: &I, map: &ImmediateClosure<'a, dyn FnMut(I::Item, u32) -> Result<U, JsError> + 'a>, ) -> Result<Array<U>, JsValue>
The Array.from() static method with a map function creates a new, shallow-copied
Array instance from an array-like or iterable object, applying the map function
to each value.
Source§impl Array
impl Array
Source§impl Array
impl Array
Sourcepub fn from_async_map<'a, I, R>(
val: &I,
map: &ScopedClosure<'a, dyn FnMut(I::Item, u32) -> Result<R, JsError>>,
) -> Result<Promise<Array<R::Resolution>>, JsValue>where
I: AsyncIterable + ErasableGenericBorrow<JsValue>,
R: Promising,
ScopedClosure<'a, dyn FnMut(I::Item, u32) -> Result<R, JsError>>: ErasableGenericBorrow<ScopedClosure<'static, dyn FnMut(JsValue, u32) -> Result<JsValue, JsError>>>,
Promise<Array<R::Resolution>>: ErasableGenericOwn<Promise<Array<JsValue>>>,
pub fn from_async_map<'a, I, R>(
val: &I,
map: &ScopedClosure<'a, dyn FnMut(I::Item, u32) -> Result<R, JsError>>,
) -> Result<Promise<Array<R::Resolution>>, JsValue>where
I: AsyncIterable + ErasableGenericBorrow<JsValue>,
R: Promising,
ScopedClosure<'a, dyn FnMut(I::Item, u32) -> Result<R, JsError>>: ErasableGenericBorrow<ScopedClosure<'static, dyn FnMut(JsValue, u32) -> Result<JsValue, JsError>>>,
Promise<Array<R::Resolution>>: ErasableGenericOwn<Promise<Array<JsValue>>>,
The Array.fromAsync() static method with a map function creates a new, shallow-copied
Array instance from an async iterable, iterable or array-like object, applying the map
function to each value.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn concat_many<U>(&self, array: &[Array<U>]) -> Array<T>
pub fn concat_many<U>(&self, array: &[Array<U>]) -> Array<T>
The concat() method is used to merge two or more arrays. This method
does not change the existing arrays, but instead returns a new array.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_find<'a>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>,
) -> Result<Option<T>, JsValue>
pub fn try_find<'a>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>, ) -> Result<Option<T>, JsValue>
The find() method returns the value of the first element in the array that satisfies
the provided testing function. Otherwise undefined is returned. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn find_index(
&self,
predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool,
) -> i32
pub fn find_index( &self, predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool, ) -> i32
The findIndex() method returns the index of the first element in the array that
satisfies the provided testing function. Otherwise -1 is returned.
Note: Consider using Array::try_find_index if the predicate might throw an error.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_find_index<'a>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>,
) -> Result<i32, JsValue>
pub fn try_find_index<'a>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>, ) -> Result<i32, JsValue>
The findIndex() method returns the index of the first element in the array that
satisfies the provided testing function. Otherwise -1 is returned. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn find_last(
&self,
predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool,
) -> T
pub fn find_last( &self, predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool, ) -> T
The findLast() method of Array instances iterates the array in reverse order
and returns the value of the first element that satisfies the provided testing function.
If no elements satisfy the testing function, undefined is returned.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_find_last<'a>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>,
) -> Result<Option<T>, JsValue>
pub fn try_find_last<'a>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>, ) -> Result<Option<T>, JsValue>
The findLast() method of Array instances iterates the array in reverse order
and returns the value of the first element that satisfies the provided testing function.
If no elements satisfy the testing function, undefined is returned. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn find_last_index(
&self,
predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool,
) -> i32
pub fn find_last_index( &self, predicate: &mut dyn FnMut(T, u32, Array<T>) -> bool, ) -> i32
The findLastIndex() method of Array instances iterates the array in reverse order
and returns the index of the first element that satisfies the provided testing function.
If no elements satisfy the testing function, -1 is returned.
Note: Consider using Array::try_find_last_index if the predicate might throw an error.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_find_last_index<'a>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>,
) -> Result<i32, JsValue>
pub fn try_find_last_index<'a>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<bool, JsError> + 'a>, ) -> Result<i32, JsValue>
The findLastIndex() method of Array instances iterates the array in reverse order
and returns the index of the first element that satisfies the provided testing function.
If no elements satisfy the testing function, -1 is returned. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_flat_map<'a, U>(
&self,
callback: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Vec<U> + 'a>,
) -> Result<Array<U>, JsValue>
pub fn try_flat_map<'a, U>( &self, callback: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Vec<U> + 'a>, ) -> Result<Array<U>, JsValue>
The flatMap() method first maps each element using a mapping function, then flattens
the result into a new array.
Source§impl<T> Array<T>where
T: JsGeneric,
impl<T> Array<T>where
T: JsGeneric,
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl Array
impl Array
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn set_length(&self, value: u32)
pub fn set_length(&self, value: u32)
Sets the length of the array.
If it is set to less than the current length of the array, it will shrink the array.
If it is set to more than the current length of the array, it will increase the length of the array, filling the new space with empty slots.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn map<U>(
&self,
predicate: &mut dyn FnMut(T, u32, Array<T>) -> U,
) -> Array<U>
pub fn map<U>( &self, predicate: &mut dyn FnMut(T, u32, Array<T>) -> U, ) -> Array<U>
map() calls a provided callback function once for each element in an array,
in order, and constructs a new array from the results. callback is invoked
only for indexes of the array which have assigned values, including undefined.
It is not called for missing elements of the array (that is, indexes that have
never been set, which have been deleted or which have never been assigned a value).
Note: Consider using Array::try_map for safer fallible handling.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_map<'a, U>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<U, JsError> + 'a>,
) -> Result<Array<U>, JsValue>
pub fn try_map<'a, U>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T, u32) -> Result<U, JsError> + 'a>, ) -> Result<Array<U>, JsValue>
map() calls a provided callback function once for each element in an array,
in order, and constructs a new array from the results. callback is invoked
only for indexes of the array which have assigned values, including undefined.
It is not called for missing elements of the array (that is, indexes that have
never been set, which have been deleted or which have never been assigned a value).
(Fallible variation)
Source§impl Array
impl Array
Sourcepub fn of<T>(values: &[T]) -> Array<T>
pub fn of<T>(values: &[T]) -> Array<T>
The Array.of() method creates a new Array instance with a variable
number of arguments, regardless of number or type of the arguments.
The difference between Array.of() and the Array constructor is in the
handling of integer arguments: Array.of(7) creates an array with a single
element, 7, whereas Array(7) creates an empty array with a length
property of 7 (Note: this implies an array of 7 empty slots, not slots
with actual undefined values).
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn pop(&self) -> Twhere
T: ErasableGenericOwn<JsValue>,
pub fn pop(&self) -> Twhere
T: ErasableGenericOwn<JsValue>,
The pop() method removes the last element from an array and returns that
element. This method changes the length of the array.
Note: Consider using Array::pop_checked for handling empty arrays.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn pop_checked(&self) -> Option<T>
pub fn pop_checked(&self) -> Option<T>
The pop() method removes the last element from an array and returns that
element. This method changes the length of the array.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_reduce<'a, A>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(A, T, u32) -> Result<A, JsError> + 'a>,
initial_value: &A,
) -> Result<A, JsValue>
pub fn try_reduce<'a, A>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(A, T, u32) -> Result<A, JsError> + 'a>, initial_value: &A, ) -> Result<A, JsValue>
The reduce() method applies a function against an accumulator and each element in
the array (from left to right) to reduce it to a single value. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_reduce_right<'a, A>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(JsValue, T, u32) -> Result<A, JsError> + 'a>,
initial_value: &A,
) -> Result<A, JsValue>
pub fn try_reduce_right<'a, A>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(JsValue, T, u32) -> Result<A, JsError> + 'a>, initial_value: &A, ) -> Result<A, JsValue>
The reduceRight() method applies a function against an accumulator and each value
of the array (from right-to-left) to reduce it to a single value. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn shift(&self) -> Twhere
T: ErasableGenericOwn<JsValue>,
pub fn shift(&self) -> Twhere
T: ErasableGenericOwn<JsValue>,
The shift() method removes the first element from an array and returns
that removed element. This method changes the length of the array.
Note: Consider using Array::shift_checked for handling empty arrays.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn shift_checked(&self) -> Option<T>
pub fn shift_checked(&self) -> Option<T>
The shift() method removes the first element from an array and returns
that removed element. This method changes the length of the array.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn slice_from(&self, start: u32) -> Array<T>
pub fn slice_from(&self, start: u32) -> Array<T>
The slice() method returns a shallow copy of a portion of an array into
a new array object selected from the given index to the end.
The original array will not be modified.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn some(&self, predicate: &mut dyn FnMut(T) -> bool) -> bool
pub fn some(&self, predicate: &mut dyn FnMut(T) -> bool) -> bool
The some() method tests whether at least one element in the array passes the test implemented
by the provided function.
Note: This method returns false for any condition put on an empty array.
Note: Consider using Array::try_some if the predicate might throw an error.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_some<'a>(
&self,
predicate: &ImmediateClosure<'a, dyn FnMut(T) -> Result<bool, JsError> + 'a>,
) -> Result<bool, JsValue>
pub fn try_some<'a>( &self, predicate: &ImmediateClosure<'a, dyn FnMut(T) -> Result<bool, JsError> + 'a>, ) -> Result<bool, JsValue>
The some() method tests whether at least one element in the array passes the test implemented
by the provided function. (Fallible variation)
Note: This method returns false for any condition put on an empty array.
MDN documentation
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn sort(&self) -> Array<T>
pub fn sort(&self) -> Array<T>
The sort() method sorts the elements of an array in place and returns
the array. The sort is not necessarily stable. The default sort
order is according to string Unicode code points.
The time and space complexity of the sort cannot be guaranteed as it is implementation dependent.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_sort_by<'a>(
&self,
compare_fn: &ImmediateClosure<'a, dyn FnMut(T, T) -> Result<i32, JsError> + 'a>,
) -> Result<Array<T>, JsValue>
pub fn try_sort_by<'a>( &self, compare_fn: &ImmediateClosure<'a, dyn FnMut(T, T) -> Result<i32, JsError> + 'a>, ) -> Result<Array<T>, JsValue>
The sort() method with a custom compare function. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn to_locale_string(&self, locales: &JsValue, options: &JsValue) -> JsString
pub fn to_locale_string(&self, locales: &JsValue, options: &JsValue) -> JsString
The toLocaleString() method returns a string representing the elements of the array.
The elements are converted to Strings using their toLocaleString methods and these
Strings are separated by a locale-specific String (such as a comma “,”).
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn to_reversed(&self) -> Array<T>
pub fn to_reversed(&self) -> Array<T>
The toReversed() method returns a new array with the elements in reversed order,
without modifying the original array.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn to_sorted_by(&self, compare_fn: &mut dyn FnMut(T, T) -> i32) -> Array<T>
pub fn to_sorted_by(&self, compare_fn: &mut dyn FnMut(T, T) -> i32) -> Array<T>
The toSorted() method with a custom compare function.
Note: Consider using Array::try_to_sorted_by if the predicate might throw an error.
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn try_to_sorted_by<'a>(
&self,
compare_fn: &ImmediateClosure<'a, dyn FnMut(T, T) -> Result<i32, JsError> + 'a>,
) -> Result<Array<T>, JsValue>
pub fn try_to_sorted_by<'a>( &self, compare_fn: &ImmediateClosure<'a, dyn FnMut(T, T) -> Result<i32, JsError> + 'a>, ) -> Result<Array<T>, JsValue>
The toSorted() method with a custom compare function. (Fallible variation)
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn unshift_many(&self, values: &[T]) -> u32
pub fn unshift_many(&self, values: &[T]) -> u32
The unshift() method adds one or more elements to the beginning of an
array and returns the new length of the array.
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>where
T: JsGeneric,
impl<T> Array<T>where
T: JsGeneric,
Sourcepub fn entries_typed(&self) -> Iterator<ArrayTuple<(Number, T)>>where
Iterator<ArrayTuple<(Number, T)>>: ErasableGenericOwn<Iterator<ArrayTuple<(Number, JsValue)>>>,
pub fn entries_typed(&self) -> Iterator<ArrayTuple<(Number, T)>>where
Iterator<ArrayTuple<(Number, T)>>: ErasableGenericOwn<Iterator<ArrayTuple<(Number, JsValue)>>>,
The entries() method returns a new Array Iterator object that contains
the key/value pairs for each index in the array.
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 AsRef<Array> for RegExpMatchArray
impl AsRef<Array> for RegExpMatchArray
Source§impl<T> ErasableGeneric for Array<T>
impl<T> ErasableGeneric for Array<T>
Source§impl<A, T: JsGeneric> Extend<A> for Array<T>where
A: AsRef<T>,
impl<A, T: JsGeneric> Extend<A> for Array<T>where
A: AsRef<T>,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = A>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = A>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<RegExpMatchArray> for Array
impl From<RegExpMatchArray> for Array
Source§fn from(obj: RegExpMatchArray) -> Array
fn from(obj: RegExpMatchArray) -> Array
Source§impl<A, T: JsGeneric> FromIterator<A> for Array<T>where
A: AsRef<T>,
Available on non-js_sys_unstable_apis only.
impl<A, T: JsGeneric> FromIterator<A> for Array<T>where
A: AsRef<T>,
js_sys_unstable_apis only.Source§impl<T> FromWasmAbi for Array<T>
impl<T> FromWasmAbi for Array<T>
Source§impl<T: JsGeneric> IntoIterator for Array<T>
impl<T: JsGeneric> IntoIterator for Array<T>
Source§impl<'a, T> IntoWasmAbi for &'a Array<T>
impl<'a, T> IntoWasmAbi for &'a Array<T>
Source§impl<T> IntoWasmAbi for Array<T>
impl<T> IntoWasmAbi for Array<T>
Source§impl<T> JsCast for Array<T>
impl<T> JsCast for Array<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> LongRefFromWasmAbi for Array<T>
impl<T> LongRefFromWasmAbi for Array<T>
Source§impl<T> OptionFromWasmAbi for Array<T>
impl<T> OptionFromWasmAbi for Array<T>
Source§impl<'a, T> OptionIntoWasmAbi for &'a Array<T>
impl<'a, T> OptionIntoWasmAbi for &'a Array<T>
Source§impl<T> OptionIntoWasmAbi for Array<T>
impl<T> OptionIntoWasmAbi for Array<T>
Source§impl<T> Promising for Array<T>
impl<T> Promising for Array<T>
Source§type Resolution = Array<T>
type Resolution = Array<T>
Source§impl<T> RefFromWasmAbi for Array<T>
impl<T> RefFromWasmAbi for Array<T>
Source§type Abi = <JsValue as RefFromWasmAbi>::Abi
type Abi = <JsValue as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = ManuallyDrop<Array<T>>
type Anchor = ManuallyDrop<Array<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: Eq> Eq for Array<T>
impl<T> StructuralPartialEq for Array<T>
impl<T, __UpcastTarget0> UpcastFrom<Array<T>> for Array<__UpcastTarget0>where
__UpcastTarget0: UpcastFrom<T>,
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<T, __UpcastTarget0> UpcastFrom<Array<T>> for JsOption<Array<__UpcastTarget0>>where
__UpcastTarget0: UpcastFrom<T>,
impl<T> UpcastFrom<Array<T>> for JsOption<Object>
impl<T> UpcastFrom<Array<T>> for JsValue
impl<T> UpcastFrom<Array<T>> for Object
impl<T1, Target> UpcastFrom<ArrayTuple<(T1,)>> for 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, T3, Target> UpcastFrom<ArrayTuple<(T1, T2, T3)>> for Array<Target>
impl<T1, T2, T3, T4, Target> UpcastFrom<ArrayTuple<(T1, T2, T3, T4)>> for 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, 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, 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, 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 UpcastFrom<RegExpMatchArray> for Array
Auto Trait Implementations§
impl<T> Freeze for Array<T>
impl<T> RefUnwindSafe for Array<T>where
T: RefUnwindSafe,
impl<T> Send for Array<T>where
T: Send,
impl<T> Sync for Array<T>where
T: Sync,
impl<T> Unpin for Array<T>where
T: Unpin,
impl<T> UnsafeUnpin for Array<T>
impl<T> UnwindSafe for Array<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.