A small correction...
...flawed.
I suspect to make progress you are going to have to admit that and understand the reason it's flawed.
Pascal (variant record) and Rust (enum) both encourage correctly handling unions. In the case of Rust it's impossible to do the flawed thing.