Crate array_fusion

Source
Expand description

Array fusion and fission utilies.

This crate contains utilities to combine multiple arrays together (aka fusion) as well as splitting them (aka fission).

This crate is based on the hybrid_array crate, which provides all the building blocks for this crate. The hybrid_array crate has its own Array type for an array type that uses the typenum type parameters to represent the size of the array, instead of the const generic array size of classic “core” arrays.

The reason of using typenum is that you can use typenums type parameters in generic context unlike the classic const generics which at the time of writing (2025) have still many limitations that limits the usability of them in generic context.

However when working within the limited scopes (and in non-generic context) the “core” arrays have much better ergonomics. Due to this ambivalence, this crate offers most functions in two variants the “normal” way is baed on hybrid_arrays Array and the “core” variant the work with the ordinary arrays.

This crate also offers convenient functions for converting between the “core” and hybrid_array arrays via array_from_core and array_to_core. Their trait bounds demonstrate the complexity of interchanging between these type. Tho, if you have a concrete array all these bounds can be inferred, and if you dont have a concrete array e.g. due to generic context, you better use the hybrid_array array.

Re-exports§

pub use hybrid_array;

Modules§

bytes
Byte oriented array utils.
chunks
Array of arrays utilities.

Macros§

merge_array
Merge multiple Arrays into one combined Array.
merge_bytes
merge_core_array
Merge core arrays into a combined core array
split_array
Splits an Array into multiple sub-Arrays.
split_bytes
split_core_array
Split a core arrays in core arrays.

Functions§

array_from_core
Convert a core array into an Array.
array_to_core
Convert an Array into a core array.