Skip to content
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

document which lifetime is needed for systemparam derive #11321

Merged
merged 7 commits into from
Jan 22, 2024

Conversation

laundmo
Copy link
Contributor

@laundmo laundmo commented Jan 13, 2024

Objective

Document a few common cases of which lifetime is required when using SystemParam Derive

Solution

Added a table in the doc comment

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea to document, but I think this will be a lot more robust as a doc test.

@laundmo laundmo changed the title add table showing systemparam required lifetime for a few common ones document which lifetime is needed for systemparam derive Jan 13, 2024
@matiqo15 matiqo15 added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events labels Jan 13, 2024
@Nilirad
Copy link
Contributor

Nilirad commented Jan 14, 2024

Great idea to document, but I think this will be a lot more robust as a doc test.

I agree, actual doc examples are more useful and less prone to desync. Also, the user can obtain the lifetime parameters from the specific SystemParam they're interested in.

@laundmo
Copy link
Contributor Author

laundmo commented Jan 15, 2024

Hope this is somewhat like you imagined? didn't want to make it visibly a codeblock, as there already is a example there. sadly no way to preserve table formatting during this... alas.

@laundmo
Copy link
Contributor Author

laundmo commented Jan 15, 2024

looks like this now

image

Copy link
Contributor

@Nilirad Nilirad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough. Not comprehensive, but sufficiently covers the most important cases. Ultimately, lifetimes can still be seen on the struct docs of the specific SystemParam.

@Nilirad Nilirad added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 19, 2024
@laundmo
Copy link
Contributor Author

laundmo commented Jan 19, 2024

Looks good enough. Not comprehensive, but sufficiently covers the most important cases. Ultimately, lifetimes can still be seen on the struct docs of the specific SystemParam.

yeah that they're available elsewhere is exactly ehy i didnt include all of them

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 22, 2024
Merged via the queue into bevyengine:main with commit e2e4e8e Jan 22, 2024
22 checks passed
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-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants