bevyengine / bevyengine/bevy

Add `SystemParam::to_read_only` to downgrade system params to shared form

Open
#7,319 0 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

See [this Discord thread](https://discord.com/channels/691052431525675048/1066466054710251580/1066466054710251580) for a concrete example of a problem this would solve.

## What solution would you like?

Learn from `WorldQuery`, and add an associated type `ReadOnly` and a `to_read_only` method to the `SystemParam` trait.

## What alternative(s) have you considered?

This could be special-cased, but it seems that almost all system param are either read-only already, or have a read-only form.

Strange edge cases like `EventWriter` could just use `()` as their `ReadOnly` type.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.