Skip to content

Fluent builder methods for bevy_reflect ParsedPaths. #13227

@viridia

Description

@viridia

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

I'd like a set of builder methods for ParsedPaths. Rather than (or in addition to) parsing paths from strings, I'd like to be able to construct paths using a fluent API. Basically I am building a tree of widgets by recursively walking the reflection data, and as I visit each field I want to construct a new path which is the concatenation of the parent path with the path segment for the field being visited.

What solution would you like?

Given a "base path" (which may be empty), I want to generate a new path which is the concatenation of the base plus a new element, which could be a name, index and so on. Similar to path.join() for directories.

What alternative(s) have you considered?

I could do this by manipulating the Vec directly, but fluent methods would be cleaner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ReflectionRuntime information about typesC-FeatureA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesX-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions