Crate chisel_json

source ·
Expand description

Another JSON Parser?

The Chisel JSON parser aims to be a relatively simple DOM and SAX parser for JSON, that does not include all the machinery required to support explicit serialisation from, and deserialisation into structs/enums within Rust.

It’s a simple little parser that is intended to allow you to choose how you want to parse a lump of cursed JSON, and then either build/transform a DOM into a richer AST structure, or alternatively just cherry-pick the useful bits of the payload via closures which are called in response to SAX parsing events.

(Because let’s face it, JSON payloads usually come burdened with a whole load of unnecessary crap that you’ll never use).

Modules

  • Coordinate structure used to reference specific locations within parser input
  • Both the DOM and SAX parser implementations operate over a stream of chars produced by some flavour of iterator. By default, this iterator is based on a decoder that will take a stream of bytes from an underlying source, and convert into a stream of chars.
  • The DOM parser
  • Error and Result types
  • Events generated by the SAX parser
  • Lexer used by both DOM and SAX parsers
  • A representation of a JSON Pointer with associated operations, as per RFC 6901
  • The SAX parser

Macros

Enums

  • Basic enumeration of different Json values