[Merged by Bors] - Mention world_query(ignore) attribute for WorldQuery derivation#6309
Closed
x3ro wants to merge 2 commits intobevyengine:mainfrom
x3ro:document-world-query-ignore
Closed
[Merged by Bors] - Mention world_query(ignore) attribute for WorldQuery derivation#6309x3ro wants to merge 2 commits intobevyengine:mainfrom x3ro:document-world-query-ignore
x3ro wants to merge 2 commits intobevyengine:mainfrom
x3ro:document-world-query-ignore
Conversation
james7132
reviewed
Oct 19, 2022
crates/bevy_ecs/src/query/fetch.rs
Outdated
| /// | ||
| /// * also implements `WorldQuery`, or | ||
| /// * is marked with `#[world_query(ignore)]`. Fields decorated with this attribute | ||
| /// will be created with the default value upon realisation. |
Member
There was a problem hiding this comment.
Please explicitly mention that Default is both required to be implemented and used in this case.
Contributor
Author
There was a problem hiding this comment.
Not 100% sure what you mean by Default is [...] required to be [...] used. Can you elaborate? For now I've only added that it needs to be implemented for the type.
Contributor
Author
|
Hey :) Do you think the PR can be merged like this, or should I make additional changes? |
Co-authored-by: James Liu <contact@jamessliu.com>
james7132
approved these changes
Oct 29, 2022
mockersf
approved these changes
Oct 29, 2022
mockersf
approved these changes
Oct 29, 2022
Member
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Nov 1, 2022
# Objective Add documentation `#[world_query(ignore)]`. Fixes #6283. --- I've only described it's behavior so far (which appears to be the same as with `system_param`). Is there another use-case for this besides with `PhantomData`? I could only find a single usage of this construct on GitHub, which is [here](https://github.com/tqwewe/bevy-editor-2/blob/ffcb816927a1bbdcf1cb0136ce47864e5040f9fb/bevy/examples/ecs/custom_query_param.rs#L102). I was also wondering if it would make sense to add a usage example to the `custom_query_example`? 🤔 That's why it's currently still in there. Co-authored-by: Lucas Jenß <243719+x3ro@users.noreply.github.com>
Contributor
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
…engine#6309) # Objective Add documentation `#[world_query(ignore)]`. Fixes bevyengine#6283. --- I've only described it's behavior so far (which appears to be the same as with `system_param`). Is there another use-case for this besides with `PhantomData`? I could only find a single usage of this construct on GitHub, which is [here](https://github.com/tqwewe/bevy-editor-2/blob/ffcb816927a1bbdcf1cb0136ce47864e5040f9fb/bevy/examples/ecs/custom_query_param.rs#L102). I was also wondering if it would make sense to add a usage example to the `custom_query_example`? 🤔 That's why it's currently still in there. Co-authored-by: Lucas Jenß <243719+x3ro@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Add documentation
#[world_query(ignore)]. Fixes #6283.I've only described it's behavior so far (which appears to be the same as with
system_param). Is there another use-case for this besides withPhantomData? I could only find a single usage of this construct on GitHub, which is here.I was also wondering if it would make sense to add a usage example to the
custom_query_example? 🤔 That's why it's currently still in there.