Expand description
Utilities for the array primitive type.
Re-exportsΒ§
pub use iter::IntoIter;
ModulesΒ§
MacrosΒ§
- array_
impl_ πdefault
StructsΒ§
- Guard π
- Panic guard for incremental initialization of arrays.
- TryFrom
Slice Error - The error type returned when a conversion from a slice to an array fails.
TraitsΒ§
- Spec
Array πClone
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 ofiter
- iter_
next_ πchunk - Pulls
N
items fromiter
and returns them as an array. If the iterator yields fewer thanN
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 - repeat
Experimental - Creates an array of type
[T; N]
by repeatedly cloning a value. - try_
from_ fn Experimental - Creates an array
[T; N]
where each fallible array elementT
is returned by thecb
call. Unlikefrom_fn
, where the element creation canβt fail, this version will return an error if any element creation was unsuccessful.