bevy/crates/bevy_asset/src
Chris Russell d0550f58ae
Remove 's lifetime from WorldQuery::Fetch (#19720)
# Objective

Unblock #18162.

#15396 added the `'s` lifetime to `QueryData::Item` to make it possible
for query items to borrow from the state. The state isn't passed
directly to `QueryData::fetch()`, so it also added the `'s` lifetime to
`WorldQuery::Fetch` so that we can pass the borrows through there.

Unfortunately, having `WorldQuery::Fetch` borrow from the state makes it
impossible to have owned state, because we store the state and the
`Fetch` in the same `struct` during iteration.

## Solution

Undo the change to add the `'s` lifetime to `WorldQuery::Fetch`.

Instead, add a `&'s Self::State` parameter to `QueryData::fetch()` and
`QueryFilter::filter_fetch()` so that borrows from the state can be
passed directly to query items.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Emerson Coskey <emerson@coskey.dev>
2025-06-19 00:58:21 +00:00
..
io Fix missing meta files breaking Bevy on itch (#19268) 2025-05-30 20:33:47 +00:00
processor Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
server allow access to the source error of AssetLoaderError and downcasting (#19471) 2025-06-16 21:24:01 +00:00
asset_changed.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00
assets.rs Add get_mut_untracked to Assets (#19487) 2025-06-04 16:34:27 +00:00
direct_access_ext.rs Improve clarity of existing bevy_assets documentation (#17830) 2025-02-13 19:49:25 +00:00
event.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
folder.rs Fill out some missing docs for bevy_assets (#17829) 2025-02-13 21:08:09 +00:00
handle.rs Deprecated Begone! 0.16 Cleanup (#19108) 2025-05-07 18:17:41 +00:00
id.rs Added derive Reflect to UntypedHandle and UntypedAssetId (#18827) 2025-04-28 21:46:36 +00:00
lib.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
loader_builders.rs Revert PR #15481 to resolve a regression. (#18567) 2025-03-27 21:32:01 +00:00
loader.rs Fix LoadContext docs. (#19610) 2025-06-13 03:48:55 +00:00
meta.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
path.rs Remove apostrophes in possessive its (#19244) 2025-05-26 19:53:14 +00:00
reflect.rs Replace UntypedHandle from ReflectAsset with impl Into<UntypedAssetId>. (#19606) 2025-06-15 16:42:54 +00:00
render_asset.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
saver.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
transformer.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00