Open
Description
> Is there a way we can make `SystemStare::get_manual` take an immutable reference to self? Similar to `QueryState::get_manual`.
At first glance, this seems very difficult to generalize. We'd have to change SystemParam::get_param
to take an immutable refence to the state, which would break params that need to modify their state such as Commands
or Local
or EventReader
.
One way of doing this would be to add a new trait for SystemParam
s that do not mutably access their state in get_param
, and then add SystemState::get_readonly
which is constrained to using this trait. This would allow most SystemParam
s to be used with a read-only SystemState
, while excluding the param types that don't make sense. I am not exactly sure what this would look like, though.
Originally posted by @JoJoJet in #7084 (comment)