Module core::array

1.36.0 · source ·
Expand description

Utilities for the array primitive type.

See also the array primitive type.

Modules

Macros

Structs

  • Guard 🔒
    Panic guard for incremental initialization of arrays.
  • A by-value array iterator.
  • The error type returned when a conversion from a slice to an array fails.

Traits

Functions

  • 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.
  • Creates an array of type [T; N], where each element T is the returned value from cb using that element’s index.
  • Converts a mutable reference to T into a mutable reference to an array of length 1 (without copying).
  • Converts a reference to T into a reference to an array of length 1 (without copying).
  • Populate an array from the first N elements of iter
  • 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.
  • Version of iter_next_chunk using a passed-in slice in order to avoid needing to monomorphize for every array length.
  • Version of try_from_fn using a passed-in slice in order to avoid needing to monomorphize for every array length.