bevy/crates/bevy_ecs/src
Vic 39a1e2b488
implement EntityIndexMap/Set (#17449)
# Objective

We do not have `EntityIndexMap`/`EntityIndexSet`.

Usual `HashMap`s/`HashSet`s do not guarantee any order, which can be
awkward for some use cases.
The `indexmap` versions remember insertion order, which then also
becomes their iteration order.
They can be thought of as a `HashTable` + `Vec`, which means fast
iteration and removal, indexing by index (not just key), and slicing!
Performance should otherwise be comparable.

## Solution

Because `indexmap` is structured to mirror `hashbrown`, it suffers the
same issue of not having the `Hasher` generic on their iterators. #16912
solved this issue for `EntityHashMap`/`EntityHashSet` with a wrapper
around the hashbrown version, so this PR does the same.

Hopefully these wrappers can be removed again in the future by having
`hashbrown`/`indexmap` adopt that generic in their iterators themselves!
2025-01-24 08:09:34 +00:00
..
entity implement EntityIndexMap/Set (#17449) 2025-01-24 08:09:34 +00:00
event Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
identifier bevy_ecs: Apply #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17335) 2025-01-14 21:37:41 +00:00
observer Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
query Add DefaultQueryFilters (#13120) 2025-01-20 21:57:39 +00:00
reflect Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
relationship Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
schedule Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
storage Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
system Track callsite for observers & hooks (#15607) 2025-01-22 20:02:39 +00:00
world Clarify docs for OnAdd, OnInsert, OnReplace, OnRemove triggers (#17512) 2025-01-24 05:40:58 +00:00
archetype.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
batching.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
bundle.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
change_detection.rs fix double comment characters (#17484) 2025-01-21 23:24:05 +00:00
component.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
entity_disabling.rs Add DefaultQueryFilters (#13120) 2025-01-20 21:57:39 +00:00
hierarchy.rs Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
intern.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
label.rs Add compile-time dyn compatible checks for DynEq, DynHash (#17254) 2025-01-09 07:30:54 +00:00
lib.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
name.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
removal_detection.rs Replace map + unwrap_or(true) with is_none_or (#17070) 2024-12-31 20:17:03 +00:00
resource.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
result.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
traversal.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00