Skip to content

Add a query_read_only that can be accessed through &World #10898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hymm opened this issue Dec 6, 2023 · 0 comments
Open

Add a query_read_only that can be accessed through &World #10898

hymm opened this issue Dec 6, 2023 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@hymm
Copy link
Contributor

hymm commented Dec 6, 2023

What problem does this solve or what need does it fill?

For something like a UI tree, it can be useful to pass around a &World to allow read only access to the world to populate the tree in multiple places. But currently you can't get a QueryState out of &World as it requires &mut World to initialize the components in the query.

What solution would you like?

Have a panicking query_read_only that can be used from &World.

A lot of the foundational work for this has been done in #9774 which adds a get_state to SystemParam, which allows building a QueryState from &World. So this should probably be built on top of that work.

@hymm hymm added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Dec 6, 2023
@JMS55 JMS55 added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

2 participants