bevy/crates/bevy_ecs/src/world
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
..
command_queue.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
component_constants.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
deferred_world.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
entity_fetch.rs make EntityHashMap and EntityHashSet proper types (#16912) 2024-12-20 20:55:45 +00:00
entity_ref.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
error.rs track_change_detection: Also track spawns/despawns (#16047) 2024-12-17 04:46:31 +00:00
filtered_resource.rs Remove OnceLock usage from bevy_ecs (#16870) 2024-12-17 22:42:42 +00:00
identifier.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
mod.rs Faster entity cloning (#16717) 2024-12-18 20:03:39 +00:00
reflect.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
spawn_batch.rs implement EntitySet and iter_many_unique methods (#16547) 2024-12-18 00:49:01 +00:00
unsafe_world_cell.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00