Module array

1.35.0 · Source
Expand description

Utilities for the array primitive type.

See also the array primitive type.

Re-exports§

pub use iter::IntoIter;

Modules§

ascii 🔒
drain 🔒
equality 🔒
iter 🔒
Defines the IntoIter owned iterator for arrays.

Macros§

array_impl_default 🔒

Structs§

Guard 🔒
Panic guard for incremental initialization of arrays.
TryFromSliceError
The error type returned when a conversion from a slice to an array fails.

Traits§

SpecArrayClone 🔒

Functions§

from_fn
Creates an array where each element is produced by calling f with that element’s index while walking forward through the array.
from_mut
Converts a mutable reference to T into a mutable reference to an array of length 1 (without copying).
from_ref
Converts a reference to T into a reference to an array of length 1 (without copying).
from_trusted_iterator 🔒
Populate an array from the first N elements of iter
iter_next_chunk 🔒
Pulls N items from iter and returns them as an array. If the iterator yields fewer than N items, Err is returned containing an iterator over the already yielded items.
iter_next_chunk_erased 🔒
Version of iter_next_chunk using a passed-in slice in order to avoid needing to monomorphize for every array length.
try_from_fn_erased 🔒
Version of try_from_fn using a passed-in slice in order to avoid needing to monomorphize for every array length.
try_from_trusted_iterator 🔒
repeatExperimental
Creates an array of type [T; N] by repeatedly cloning a value.
try_from_fnExperimental
Creates an array [T; N] where each fallible array element T is returned by the cb call. Unlike from_fn, where the element creation can’t fail, this version will return an error if any element creation was unsuccessful.