JsonTokenParser¶
Streaming JSON token parser. Parses a JSON string and emits tokens to a JsonTokenNotify callback. This is the lower-level API — most users should use JsonParser.parse() instead. Use this when you need to process large documents without materializing the full tree.
Constructors¶
create¶
Parameters¶
- notify': JsonTokenNotify ref
Returns¶
- JsonTokenParser ref^
Public fields¶
var last_number: (I64 val | F64 val)¶
The most recently parsed number value.
var last_string: String val¶
The most recently parsed string or key value.
Public Functions¶
parse¶
Parse a JSON document, emitting tokens to the notify callback.
Parameters¶
- source': String box
Returns¶
- None val ?
abort¶
Signal the parser to stop after the current token.
Returns¶
- None val
token_start¶
Byte offset where the current token starts.
Returns¶
- USize val
token_end¶
Byte offset where the current token ends.
Returns¶
- USize val
line¶
Current line number (1-based).
Returns¶
- USize val
describe_error¶
Human-readable description of the error location.
Returns¶
- String val