bevy/crates/bevy_ecs/src/entity
Vic 8ac90ac542
make EntityHashMap and EntityHashSet proper types (#16912)
# Objective

`EntityHashMap` and `EntityHashSet` iterators do not implement
`EntitySetIterator`.

## Solution

Make them newtypes instead of aliases. The methods that create the
iterators can then produce their own newtypes that carry the `Hasher`
generic and implement `EntitySetIterator`. Functionality remains the
same otherwise.
There are some other small benefits, f.e. the removal of `with_hasher`
associated functions, and the ability to implement more traits
ourselves.

`MainEntityHashMap` and `MainEntityHashSet` are currently left as the
previous type aliases, because supporting general `TrustedEntityBorrow`
hashing is more complex. However, it can also be done.

## Testing

Pre-existing `EntityHashMap` tests.

## Migration Guide

Users of `with_hasher` and `with_capacity_and_hasher` on
`EntityHashMap`/`Set` must now use `new` and `with_capacity`
respectively.
If the non-newtyped versions are required, they can be obtained via
`Deref`, `DerefMut` or `into_inner` calls.
2024-12-20 20:55:45 +00:00
..
clone_entities.rs Faster entity cloning (#16717) 2024-12-18 20:03:39 +00:00
entity_set.rs Remove bevy_core (#16897) 2024-12-19 18:36:51 +00:00
hash_map.rs make EntityHashMap and EntityHashSet proper types (#16912) 2024-12-20 20:55:45 +00:00
hash_set.rs make EntityHashMap and EntityHashSet proper types (#16912) 2024-12-20 20:55:45 +00:00
hash.rs make EntityHashMap and EntityHashSet proper types (#16912) 2024-12-20 20:55:45 +00:00
map_entities.rs Change ReflectMapEntities to operate on components before insertion (#15422) 2024-10-01 18:34:09 +00:00
mod.rs make EntityHashMap and EntityHashSet proper types (#16912) 2024-12-20 20:55:45 +00:00
visit_entities.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00