bevy/crates/bevy_ecs/src
Joshua Chapman 274ace790b Implement iter() for mutable Queries (#2305)
A sample implementation of how to have `iter()` work on mutable queries without breaking aliasing rules.

# Objective

- Fixes #753

## Solution

- Added a ReadOnlyFetch to WorldQuery that is the `&T` version of `&mut T` that is used to specify the return type for read only operations like `iter()`.
- ~~As the comment suggests specifying the bound doesn't work due to restrictions on defining recursive implementations (like `Or`). However bounds on the functions are fine~~ Never mind I misread how `Or` was constructed, bounds now exist.
- Note that the only mutable one has a new `Fetch` for readonly as the `State` has to be the same for any of this to work


Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-12-01 23:28:10 +00:00
..
entity Improve bevy_ecs and bevy_app API docs where referenced by the new Bevy Book (#2365) 2021-09-17 18:00:29 +00:00
query Implement iter() for mutable Queries (#2305) 2021-12-01 23:28:10 +00:00
schedule Merge New Renderer 2021-11-22 23:57:42 -08:00
storage Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
system Implement iter() for mutable Queries (#2305) 2021-12-01 23:28:10 +00:00
world Add entity ID to expect() message (#2943) 2021-10-10 23:04:05 +00:00
archetype.rs Improve bevy_ecs and bevy_app API docs where referenced by the new Bevy Book (#2365) 2021-09-17 18:00:29 +00:00
bundle.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
change_detection.rs default features from bevy_asset and bevy_ecs can actually be disabled (#3097) 2021-11-13 21:15:22 +00:00
component.rs Fix typo (#2944) 2021-10-10 22:42:01 +00:00
event.rs Implement and require #[derive(Component)] on all component structs (#2254) 2021-10-03 19:23:44 +00:00
lib.rs Merge New Renderer 2021-11-22 23:57:42 -08:00
reflect.rs Improve bevy_ecs and bevy_app API docs where referenced by the new Bevy Book (#2365) 2021-09-17 18:00:29 +00:00