bevy/crates/bevy_reflect/src
TheBigCheese 3d3444b981 impl Reflect for std::collections::HashMap instead of only bevy::utils::HashMap (#7739) (#7782)
# Objective

Implement `Reflect` for `std::collections::HashMap<K, V, S>` as well as `hashbrown::HashMap<K, V, S>` rather than just for `hashbrown::HashMap<K, V, RandomState>`. Fixes #7739.

## Solution

Rather than implementing on `HashMap<K, V>` I instead implemented most of the related traits on `HashMap<K, V, S> where S: BuildHasher + Send + Sync + 'static` and then `FromReflect` also needs the extra bound `S: Default` because it needs to use `with_capacity_and_hasher` so needs to be able to generate a default hasher.

As the API of `hashbrown::HashMap` is identical to `collections::HashMap` making them both work just required creating an `impl_reflect_for_hashmap` macro like the `impl_reflect_for_veclike` above and then applying this to both HashMaps.

---

## Changelog

`std::collections::HashMap` can now be reflected. Also more `State` generics than just `RandomState` can now be reflected for both `hashbrown::HashMap` and `collections::HashMap`
2023-02-27 21:37:36 +00:00
..
enums bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
impls impl Reflect for std::collections::HashMap instead of only bevy::utils::HashMap (#7739) (#7782) 2023-02-27 21:37:36 +00:00
serde Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
array.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
fields.rs bevy_reflect: Reflect doc comments (#6234) 2022-10-18 13:49:57 +00:00
from_reflect.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
lib.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
list.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
map.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
path.rs bevy_reflect: Support tuple reflection paths (#7324) 2023-02-06 21:22:45 +00:00
reflect.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
std_traits.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
struct_trait.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
tuple_struct.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
tuple.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
type_info.rs bevy_reflect: Improved documentation (#7148) 2023-02-18 20:42:01 +00:00
type_registry.rs bevy_reflect: Add missing primitive registrations (#7815) 2023-02-25 21:51:06 +00:00
type_uuid_impl.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
type_uuid.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
utility.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00