Mixed Array
Construct arrays of mixed types. Generic enums are created for up to 12 unique types. A macro to generate an array using the correct size macro is provided.
Usage
- Include in the
Cargo.toml
file:
[]
= "0.1.0"
- Import and use the
mixed_array
macro to create an array of items
use mixed_array;
use Ordering;
// define a struct with a generic so the generated types are different as a demo
//implement ordering for our item for any T
Alternatives
- Frunk - HList - Provides a `hlist`` macro to construct a recursive custom data type used for storing different types (replaces using an array), easy conversion to tuples.