bevy/crates/bevy_ecs/src
Jamie Ridding dcf24dfd6b
Implement WorldQuery and QueryData on Mut. (#13338)
# Objective

Provides a `WorldQuery` implementation on `Mut<T>` that forwards to the
implementation on `&mut T`, and give users a way to opt-in to change
detection in auto-generated `QueryData::ReadOnly` types.

Fixes #13329.

## Solution

I implemented `WorldQuery` on `Mut<'w, T>` as a forwarding
implementation to `&mut T`, setting the `QueryData::ReadOnly` associated
type to `Ref<'w, T>`. This provides users the ability to explicitly
opt-in to change detection in the read-only forms of queries.

## Testing

A documentation test was added to `Mut` showcasing the new
functionality.

---

## Changelog

### Added

- Added an implementation of `WorldQuery` and `QueryData` on
`bevy_ecs::change_detection::Mut`.
2024-05-14 12:38:31 +00:00
..
entity Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
identifier Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
query Implement WorldQuery and QueryData on Mut. (#13338) 2024-05-14 12:38:31 +00:00
reflect Make from_reflect_or_world also try ReflectDefault and improve some comments and panic messages (#12499) 2024-04-30 00:48:46 +00:00
schedule Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
storage Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
system constrain WorldQuery::get_state to only use &Components (#13343) 2024-05-13 21:00:01 +00:00
world Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
archetype.rs Adding some docs for archetype internals (#12578) 2024-03-23 01:48:31 +00:00
batching.rs Parallel event reader (#12554) 2024-04-22 16:37:42 +00:00
bundle.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
change_detection.rs Implement WorldQuery and QueryData on Mut. (#13338) 2024-05-14 12:38:31 +00:00
component.rs Fix uses of "it's" vs "its". (#13033) 2024-04-19 18:17:31 +00:00
event.rs Add color conversions #13224 (#13276) 2024-05-09 18:01:52 +00:00
intern.rs Moves intern and label modules into bevy_ecs (#12772) 2024-04-08 15:34:11 +00:00
label.rs Use ptr::from_ref and ptr::addr_eq in macro (#13081) 2024-04-24 01:54:24 +00:00
lib.rs Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
removal_detection.rs Add RemovedComponentEvents::iter (#12815) 2024-04-01 20:20:30 +00:00