stadium
provides the [Stadium
] structure. This datastructure allows you to allocate any given set of objects (that can be of different types) in a continuous chunk of the memory.
Example
// The first step is to build the stadium using a builder.
// This registers the data that will be used inside of the stadium.
let mut builder = builder;
let h_vec = builder.insert;
let h_str = builder.insert;
let h_int_a = builder.insert;
let h_int_b = builder.insert
// Once the initialization is done, the actual stadium can be created.
let mut stadium = builder.build;
// Values can be retrieved.
assert_eq!;
assert_eq!;
assert_eq!;
// Or mutated.
stadium.push;
stadium = 70;
// Other operations are supported.
assert_eq!;
stadium.swap;
assert_eq!;
assert_eq!;