-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fluent builder methods for bevy_reflect ParsedPaths. #13227
Copy link
Copy link
Open
Labels
A-ReflectionRuntime information about typesRuntime information about typesC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ReflectionRuntime information about typesRuntime information about typesC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon