Easy reflection type traversal utils
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
Currently, it is non-trivial to search for and patch a specific type nested deep inside a `dyn Reflect`.
## What solution would you like?
Add an `iter_children` (name bikesheddable) iterator function on `Reflect` that returns a `ChildrenIter` (name bikesheddable) over all *direct* children. `ChildrenIter` will be an enum with the same same variants as `ReflectKind`, but it also holds a reference to the iterator of the erased data trait.
e.g. `Struct(IterFields<'a>)`
This is needed for `Reflect` to still be object-safe.
It should also exist an `iter_children_mut`, which is blocked on #14846
## What alternative(s) have you considered?
Writing that myself.
Contributor guide
Assessment
This issue has not been assessed yet.