I would like to implement this C code which uses a flexible array member (sometimes called the struct hack) in Rust:
struct test {
int key;
int dataSize;
int data[];
};
struct test* t = malloc(sizeof(struct test) + sizeOfData)
The empty array at the end of structure allows you to allocate your meta fields and data all at once. Unfortunately, I can't figure out how to do such thing in Rust.