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

[Merged by Bors] - Document options for !Sync types for Component and Resources #6864

Closed

Conversation

james7132
Copy link
Member

Objective

It's not clear to users how to handle !Sync types as components and resources in the absence of engine level support for them.

Solution

Added a section to Component's and Resource's type level docs on available options for making a type Sync when it holds !Sync fields, linking bevy_utils::synccell::SyncCell and the currently unstable std::sync::Exclusive.

Also added a compile_fail doctest that illustrates how to apply SyncCell. These will break when/if #6572 gets merged, at which point these docs should be updated.

@james7132 james7132 added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events labels Dec 5, 2022
Copy link
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

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

Good to merge as is, comments are suggestions

crates/bevy_ecs/src/system/system_param.rs Show resolved Hide resolved
crates/bevy_ecs/src/component.rs Show resolved Hide resolved
@alice-i-cecile alice-i-cecile 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 Dec 9, 2022
@james7132 james7132 added this to the 0.10 milestone Dec 10, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Dec 11, 2022
# Objective
It's not clear to users how to handle `!Sync` types as components and resources in the absence of engine level support for them. 

## Solution
Added a section to `Component`'s and `Resource`'s type level docs on available options for making a type `Sync` when it holds `!Sync` fields, linking `bevy_utils::synccell::SyncCell` and the currently unstable `std::sync::Exclusive`.

Also added a compile_fail doctest that illustrates how to apply `SyncCell`. These will break when/if #6572 gets merged, at which point these docs should be updated.
@bors bors bot changed the title Document options for !Sync types for Component and Resources [Merged by Bors] - Document options for !Sync types for Component and Resources Dec 11, 2022
@bors bors bot closed this Dec 11, 2022
@james7132 james7132 deleted the docs-sync-component-resources branch December 12, 2022 04:00
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
…ine#6864)

# Objective
It's not clear to users how to handle `!Sync` types as components and resources in the absence of engine level support for them. 

## Solution
Added a section to `Component`'s and `Resource`'s type level docs on available options for making a type `Sync` when it holds `!Sync` fields, linking `bevy_utils::synccell::SyncCell` and the currently unstable `std::sync::Exclusive`.

Also added a compile_fail doctest that illustrates how to apply `SyncCell`. These will break when/if bevyengine#6572 gets merged, at which point these docs should be updated.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…ine#6864)

# Objective
It's not clear to users how to handle `!Sync` types as components and resources in the absence of engine level support for them. 

## Solution
Added a section to `Component`'s and `Resource`'s type level docs on available options for making a type `Sync` when it holds `!Sync` fields, linking `bevy_utils::synccell::SyncCell` and the currently unstable `std::sync::Exclusive`.

Also added a compile_fail doctest that illustrates how to apply `SyncCell`. These will break when/if bevyengine#6572 gets merged, at which point these docs should be updated.
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.

7 participants