-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds support for parsing json from the prefix of a string. It does so via two small api additions: - Deserializer now has the `into_reader` associated function, which consume the deserializer and returns reader it has been using. - StrRead and SliceRead now have the `index` associated function, which reports the byte index of the data which will be read next. These can be used to parse a single value (or multiple values) from an input string or buffer, and then recover the next byte position from the reader. It allows the json parser to be easily integrated into an outer parser, where the JSON data is sitting inside some larger non-JSON context.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters