Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support string prefix parsing #995

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 7, 2023

  1. Support string prefix parsing

    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.
    mullr committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    08b9823 View commit details
    Browse the repository at this point in the history