Skip to content

reflect: insert and remove methods for List #7061

Closed
@soqb

Description

@soqb

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

Currently, the reflect List trait implements only push and pop functionality. There is no way to insert or remove elements other than from/to the end other than by downcasting. This is especially notable using types like VecDeque with reflection.

What solution would you like?

Add insert and remove methods for List and implement them.
Give push and pop default implementations using on the insert/remove and len methods.

What alternative(s) have you considered?

We might not need to implement the methods by default but since we can I believe we should as to not put to much burden on the implementor.

Additional context

Discussed first on discord.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions