Description
What problem does this solve or what need does it fill?
Bevy bundles a few hash map / hash set implementations suitable for games (i.e. performant above all else) publicly in bevy_utils
. Currently it's a combination of hashbrown (an implementation of the awesome abseil swisstables) and a fast hashing algorithm. However, the hash map does not support reflection serialization (does not implement the relevant traits), which makes it impossible to use with moonshine_save (or any other reflection-based save/load system).
What solution would you like?
Just implement Serialize
/Deserialize
on HashMap and HashSet. hashbrown already has the relevant serde implementations, so there is no technical reason why this shouldn't work (hand off to the serde implementation for both serializing and deserializing).
What alternative(s) have you considered?
Not sure if there is an elegant workaround, the reflection system is so opaque to me that I can't figure out how to implement ReflectSerialize (or any other trait, idk) for HashSet. I'd appreciate one, though.