pub struct JsonRenderer<O: TextOut> { /* private fields */ }Expand description
Renders JsonEvents/1 as JSON text.
Exactly one root value, then End; a second root, an End before the
root or with a container open, a key outside an object or where a value
is due, a value where a key is due, an unbalanced or mismatched close,
and any event after End are PROTOCOL_ORDER_ERROR. Numbers write
their lexeme when it is a JSON number (INVALID_NUMBER otherwise) and
the shortest text that reads back as the value when there is none; NaN
and infinity have no JSON form and are TARGET_VALUE_UNREPRESENTABLE,
whatever lexeme stands beside them. A number is checked before its
separator is written, so a rejected value leaves no trace. The output
is flushed once, at End; a failure found after any text was written
says so with committed_output.