Skip to content

add missing run support for SystemHandle - #24527

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
hxYuki:invoke-system-handle
Jun 7, 2026
Merged

add missing run support for SystemHandle#24527
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
hxYuki:invoke-system-handle

Conversation

@hxYuki

@hxYuki hxYuki commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Objective

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

world.run_system(handle)

// or borrowing from a reference
world.run_system(&handle)

@ickshonpe ickshonpe added A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 5, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in ECS Jun 5, 2026
@ickshonpe ickshonpe added D-Straightforward Simple bug fixes and API improvements, docs, test and examples C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Jun 5, 2026

@mardzie mardzie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me. I am not familiar with the deeper context though.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 7, 2026
@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Jun 7, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Jun 7, 2026
Merged via the queue into bevyengine:main with commit 1816829 Jun 7, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in ECS Jun 7, 2026
@hxYuki
hxYuki deleted the invoke-system-handle branch June 8, 2026 08:39
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)
```
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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants