Representing closed trait objects as enums


This would be so cool! For one thing a Vec/Hashmap full of enums would run so much faster than a Vec<Box> etc. (values appear in eachother’s cache lines)

I think a lot of use cases I care about however, benefit from additional Ref and RefMut enums anyway, so I might prefer to create some macroes to generate these types together.

But yes closed traits represent big cache optimizations that are currently a pain to implement! :heart: