ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

Iterator over Element

Open almann opened this issue 2 years ago • 0 comments

As a user, it would be nice to be able to iterate over any Element as though it were a collection. The typical use case is that something is a non-sequence and it becomes a sequence subsequently (e.g., a field that used to be a single flag represented with a symbol, but now can be multiple flags represented as a list of symbol values).

For this, we could add something like Element::over_iter() -> Iterator<Item=&Element> (I think the spelling needs work) which would iterate over a sequence's element's or for any other type iterate over itself (effectively treating non-sequences as singletons).

almann avatar Apr 01 '23 19:04 almann