Skip to content

WorldQuery::init_state signature is too generous #13358

@alice-i-cecile

Description

@alice-i-cecile

I realized that because Storages and Components aren't public fields on World, and there are no mutable accessor functions, doing the same change likely doesn't work for init_state.
Adding mutable accessor function does not make sense, because this would allow users to readily cause UB.
Instead we could have a function on &mut World that returns an opaque struct on which init_component, ... can be called.

Originally posted by @Victoronz in #13343 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsD-ComplexQuite challenging from either a design or technical perspective. Ask for help!S-Needs-ReviewNeeds reviewer attention (from anyone!) to move forwardX-ContentiousThere are nontrivial implications that should be thought through

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions