Module array

Source
Expand description

This module provides different helpers in creating constant sized arrays and converting them to different formats.

Functions in this module are not necessarily optimal in terms of allocations, as they tend to create intermediate vectors. For better performance, either optimise this code, or use (non-fixed-sized) vectors.

Functionsยง

vec_to_boxed_array
Converts a vector of elements to a boxed one. Semantically equivalent to vector.into_boxed_slice().try_into().unwrap().
vec_to_boxed_array2
Converts a two-dimensional vector to a constant sized two-dimensional array.
vec_to_boxed_array3
Converts a three-dimensional vector to a constant sized two-dimensional array.