Expand description
Utilities for the array primitive type.
Re-exportsΒ§
use crate::borrow::Borrow;πuse crate::borrow::BorrowMut;πuse crate::clone::TrivialClone;πExperimental use crate::cmp::Ordering;πuse crate::error::Error;πuse crate::hash;πuse crate::hash::Hash;πuse crate::hash::Hash;πuse crate::intrinsics::transmute_unchecked;πExperimental use crate::iter::TrustedLen;πExperimental use crate::iter::repeat_n;πuse crate::marker::Destruct;πExperimental use crate::mem;πuse crate::mem::ManuallyDrop;πuse crate::mem::MaybeUninit;πuse crate::ops::ChangeOutputType;πExperimental use crate::ops::ControlFlow;πuse crate::ops::FromResidual;πExperimental use crate::ops::Index;πuse crate::ops::IndexMut;πuse crate::ops::NeverShortCircuit;πuse crate::ops::Residual;πExperimental use crate::ops::Try;πExperimental use crate::ptr::null;πuse crate::ptr::null_mut;πuse crate::slice::Iter;πuse crate::slice::IterMut;πuse crate::fmt;πuse crate::ptr;πpub use iter::IntoIter;
ModulesΒ§
MacrosΒ§
- array_
impl_ πdefault
StructsΒ§
- Guard π
- Panic guard for incremental initialization of arrays.
- Guard
Back π - Panic guard for incremental initialization of arrays from the back.
- TryFrom
Slice Error - The error type returned when a conversion from a slice to an array fails.
TraitsΒ§
- Spec
Array πClone - Spec
Next πChunk - Spec
Next πChunk Back
FunctionsΒ§
- from_fn
- Creates an array where each element is produced by calling
fwith that elementβs index while walking forward through the array. - from_
mut - Converts a mutable reference to
Tinto a mutable reference to an array of length 1 (without copying). - from_
ref - Converts a reference to
Tinto a reference to an array of length 1 (without copying). - iter_
next_ πchunk - Pulls
Nitems fromiterand returns them as an array. If the iterator yields fewer thanNitems,Erris returned containing an iterator over the already yielded items. - iter_
next_ πchunk_ back - Pulls
Nitems from the back ofiterand returns them as an array. If the iterator yields fewer thanNitems,Erris returned containing an iterator over the already yielded items. - iter_
next_ πchunk_ back_ erased - Version of
iter_next_chunk_backusing a passed-in slice in order to avoid needing to monomorphize for every array length. - iter_
next_ πchunk_ erased - Version of
iter_next_chunkusing a passed-in slice in order to avoid needing to monomorphize for every array length. - repeat
- Creates an array of type
[T; N]by repeatedly cloning a value. - try_
from_ πfn_ erased - Version of
try_from_fnusing a passed-in slice in order to avoid needing to monomorphize for every array length. - write π β
- write_
back π β - try_
from_ fn Experimental - Creates an array
[T; N]where each fallible array elementTis returned by thecbcall. Unlikefrom_fn, where the element creation canβt fail, this version will return an error if any element creation was unsuccessful.