mirror of
https://github.com/bevyengine/bevy
synced 2025-01-03 00:38:56 +00:00
5c680a38a7
# Objective - Implementing logic used by system params and `UnsafeWorldCell` on `&World` is sus since `&World` generally denotes shared read only access to world but this is a lie in the above situations. Move most/all logic that uses `&World` to mean `UnsafeWorldCell` onto `UnsafeWorldCell` - Add a way to take a `&mut World` out of `UnsafeWorldCell` and use this in `WorldCell`'s `Drop` impl instead of a `UnsafeCell` field --- ## Changelog - changed some `UnsafeWorldCell` methods to take `self` instead of `&self`/`&mut self` since there is literally no point to them doing that - `UnsafeWorldCell::world` is now used to get immutable access to the whole world instead of just the metadata which can now be done via `UnsafeWorldCell::world_metadata` - `UnsafeWorldCell::world_mut` now exists and can be used to get a `&mut World` out of `UnsafeWorldCell` - removed `UnsafeWorldCell::storages` since that is probably unsound since storages contains the actual component/resource data not just metadata ## Migration guide N/A none of the breaking changes here make any difference for a 0.9->0.10 transition since `UnsafeWorldCell` did not exist in 0.9 |
||
---|---|---|
.. | ||
entity_ref.rs | ||
identifier.rs | ||
mod.rs | ||
spawn_batch.rs | ||
unsafe_world_cell.rs | ||
world_cell.rs |