Skip to content

Commit

Permalink
make WorldQuery very flat (bevyengine#5205)
Browse files Browse the repository at this point in the history
# Objective

Simplify the worldquery trait hierarchy as much as possible by putting it all in one trait. If/when gats are stabilised this can be trivially migrated over to use them, although that's not why I made this PR, those reasons are:
- Moves all of the conceptually related unsafe code for a worldquery next to eachother
- Removes now unnecessary traits simplifying the "type system magic" in bevy_ecs

---

## Changelog

All methods/functions/types/consts on `FetchState` and `Fetch` traits have been moved to the `WorldQuery` trait and the other traits removed. `WorldQueryGats` now only contains an `Item` and `Fetch` assoc type.

## Migration Guide
Implementors should move items in impls to the `WorldQuery/Gats` traits and remove any `Fetch`/`FetchState` impls
Any use sites of items in the `Fetch`/`FetchState` traits should be updated to use the `WorldQuery` trait items instead


Co-authored-by: Carter Anderson <mcanders1@gmail.com>
  • Loading branch information
2 people authored and james7132 committed Oct 28, 2022
1 parent d2ccceb commit eaf548a
Show file tree
Hide file tree
Showing 6 changed files with 901 additions and 1,051 deletions.
247 changes: 117 additions & 130 deletions crates/bevy_ecs/macros/src/fetch.rs

Large diffs are not rendered by default.

Loading

0 comments on commit eaf548a

Please sign in to comment.