bevy/crates/bevy_ecs/src/query
Joseph 8cc255c2f0
Hide UnsafeWorldCell::unsafe_world (#9741)
# Objective

We've done a lot of work to remove the pattern of a `&World` with
interior mutability (#6404, #8833). However, this pattern still persists
within `bevy_ecs` via the `unsafe_world` method.

## Solution

* Make `unsafe_world` private. Adjust any callsites to use
`UnsafeWorldCell` for interior mutability.
* Add `UnsafeWorldCell::removed_components`, since it is always safe to
access the removed components collection through `UnsafeWorldCell`.

## Future Work

Remove/hide `UnsafeWorldCell::world_metadata`, once we have provided
safe ways of accessing all world metadata.

---

## Changelog

+ Added `UnsafeWorldCell::removed_components`, which provides read-only
access to a world's collection of removed components.
2023-10-02 12:46:43 +00:00
..
access.rs Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
error.rs Moved get_component(_unchecked_mut) from Query to QueryState (#9686) 2023-09-11 19:04:22 +00:00
fetch.rs Add mutual exclusion safety info on filter_fetch (#9836) 2023-09-19 21:49:33 +00:00
filter.rs Hide UnsafeWorldCell::unsafe_world (#9741) 2023-10-02 12:46:43 +00:00
iter.rs Fix safety invariants for WorldQuery::fetch and simplify cloning (#8246) 2023-07-25 21:16:22 +00:00
mod.rs Moved get_component(_unchecked_mut) from Query to QueryState (#9686) 2023-09-11 19:04:22 +00:00
par_iter.rs Round up for the batch size to improve par_iter performance (#9814) 2023-09-18 16:02:58 +00:00
state.rs Hide UnsafeWorldCell::unsafe_world (#9741) 2023-10-02 12:46:43 +00:00