You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After using JsonReader::seek_to and consuming a value it is currently not easily possible to get back to the original nesting level again to continue reading there (except for the top-level with JsonReader::skip_to_top_level).
Enhancement description
Add a method for 'undoing' a seek_to by consuming all remaining array items and object members and closing arrays and objects in reverse order.
The implementation for this was already added for #48 & #49 but is currently internal, see src/reader/simple.rs function undo_seek. It would make sense to move it to JsonReader, but add additional validation there that it properly detects an incorrect state, even if the path is empty (if possible?).
Maybe need a better name for this than 'undo' because it might give the incorrect impression that afterwards the reader is at the exact same position it was before and can read the same value again.
Alternatives / workarounds
Use the Simple API instead of JsonReader? (probably not always possible)
The text was updated successfully, but these errors were encountered:
Problem solved by the enhancement
After using
JsonReader::seek_to
and consuming a value it is currently not easily possible to get back to the original nesting level again to continue reading there (except for the top-level withJsonReader::skip_to_top_level
).Enhancement description
Add a method for 'undoing' a
seek_to
by consuming all remaining array items and object members and closing arrays and objects in reverse order.The implementation for this was already added for #48 & #49 but is currently internal, see
src/reader/simple.rs
functionundo_seek
. It would make sense to move it toJsonReader
, but add additional validation there that it properly detects an incorrect state, even if the path is empty (if possible?).Maybe need a better name for this than 'undo' because it might give the incorrect impression that afterwards the reader is at the exact same position it was before and can read the same value again.
Alternatives / workarounds
Use the Simple API instead of
JsonReader
? (probably not always possible)The text was updated successfully, but these errors were encountered: