Expose `SystemMeta` fields
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
`bevy_ecs`' internal implementation of the default `SystemParam`s use `SystemMeta` to initialize their states. Yet, only the `is_send()` field accessor is public to end-users and all other fields are `pub(crate)`.
```rust
/// The metadata of a [`System`].
#[derive(Clone)]
pub struct SystemMeta {
pub(crate) name: Cow<'static, str>,
pub(crate) component_access_set: FilteredAccessSet,
pub(crate) archetype_component_access: Access,
// NOTE: this must be kept private. making a SystemMeta non-send is irreversible to prevent
// SystemParams from overriding each other
is_send: bool,
pub(crate) last_change_tick: u32,
}
```
Given that it's possible to directly implement `SystemParam` (and `SystemParamFetch`) for user-defined types in an `unsafe impl`, these fields should be exposed to advanced users.
## What solution would you like?
Add unsafe mutable and safe immutable accessors for `component_access_set` and `archetype_component_access`, and immutable accessors for `name` and `last_change_tick`.
Contributor guide
Research direction
Locate SystemMeta in bevy_ecs and review the existing public is_send() accessor alongside the SystemParam and SystemParamFetch implementations. Verify that the requested accessors cover name, last_change_tick, component_access_set, and archetype_component_access with the stated mutability and safety expectations, then confirm the public API compiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100