ion-rust
ion-rust copied to clipboard
Iterator over Element
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).