Skip to main content

Module array

Module array 

1.35.0 Β· Source
Expand description

Utilities for the array primitive type.

See also 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Β§

ascii πŸ”’
drain πŸ”’
equality πŸ”’
iter πŸ”’
Defines the IntoIter owned iterator for arrays.

MacrosΒ§

array_impl_default πŸ”’

StructsΒ§

Guard πŸ”’
Panic guard for incremental initialization of arrays.
GuardBack πŸ”’
Panic guard for incremental initialization of arrays from the back.
TryFromSliceError
The error type returned when a conversion from a slice to an array fails.

TraitsΒ§

SpecArrayClone πŸ”’
SpecNextChunk πŸ”’
SpecNextChunkBack πŸ”’

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).
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_back πŸ”’
Pulls N items from the back of 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_back_erased πŸ”’
Version of iter_next_chunk_back using a passed-in slice in order to avoid needing to monomorphize for every array length.
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.
repeat
Creates an array of type [T; N] by repeatedly cloning a value.
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.
write πŸ”’ ⚠
write_back πŸ”’ ⚠
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.