Skip to content

Conversation

@menochs1
Copy link

@menochs1 menochs1 commented Nov 1, 2025

Objective

fixes #12587

This issue is a more specific form of #8770, which has been open for over nine months with no apparent resolution.

The caching example for SystemState in the documentation shows the use of a function-local struct to cache a SystemState object. However, caching a SystemState has gotten easier since this documentation was written - with the addition of ExclusiveSystemParam and its implementation on &'a mut SystemState

, we can have the ECS handle caching for us.

The documentation should be updated to reflect this.

Solution

  • Updated doccumentation to reach the goal state above

Testing

No testing was needed; however, review should ensure I actually achieved the goal state above. I believe, to the best of my abilities, I have but I have never interacted with rust of a codebase as large as this before.


@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

#[inline]
pub fn set_non_send(&mut self) {
self.flags |= SystemStateFlags::NON_SEND;
/// Alternatively, for exclusive systems the ECS can automatically cache a
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this is where this doc comment is meant to be at all.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Nov 3, 2025
@alice-i-cecile alice-i-cecile changed the title Mason branch Document SystemState + exclusive system patterns Nov 3, 2025
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-Waiting-on-Author The author needs to make changes or address concerns before this can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SystemState can be cached using its ExclusiveSystemParam implementation, but the docs don't mention this.

3 participants