quick-xml
quick-xml copied to clipboard
Is there any way to read an event and not consume it?
just like peek()
in the iterators
Reader
does not buffer events that it reads, so you cannot peek
them, but you can create your own wrapper around the reader that would store the last readed event. That approach is used in the Deserializer
:
https://github.com/tafia/quick-xml/blob/2eecf00ee62e8b15d79724d63661c3abc582dd7a/src/de/mod.rs#L473-L486
We could introduce a PeekableReader
that will have that logic. PR is welcome.