add missing run support for SystemHandle - #24527
Merged
Merged
Conversation
mardzie
approved these changes
Jun 6, 2026
mardzie
left a comment
There was a problem hiding this comment.
Looks good to me. I am not familiar with the deeper context though.
alice-i-cecile
approved these changes
Jun 7, 2026
mockersf
pushed a commit
that referenced
this pull request
Jun 10, 2026
# Objective - The `SystemHandle` was introduced in #24165. But it didn't come with full `run_system` support. ## Solution - Implement `From<SystemHandle<I, O>>` and `From<&SystemHandle<I, O>>` for `SystemId<I, O>` to make it available for `run_system`. Using `SystemHandle::entity()` and `SystemId::from_entity()`. - Let `Commands::run_system*` and `commands::command::run_system*` to accept `impl Into<SystemId>` ## Testing - Add a test `system::system_registry::tests::run_system_with_owned_system_handle`, to run a `SystemHandle`. --- ## Showcase ```rust world.run_system(handle) // or borrowing from a reference world.run_system(&handle) ```
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
SystemHandlewas introduced in Tracked one-shot systems #24165. But it didn't come with fullrun_systemsupport.Solution
From<SystemHandle<I, O>>andFrom<&SystemHandle<I, O>>forSystemId<I, O>to make it available forrun_system. UsingSystemHandle::entity()andSystemId::from_entity().Commands::run_system*andcommands::command::run_system*to acceptimpl Into<SystemId>Testing
system::system_registry::tests::run_system_with_owned_system_handle, to run aSystemHandle.Showcase