Skip to main content

Module json

Module json 

Source
Expand description

The JSON the runner writes, and the one it reads back.

The report is a fixed shape – the fields the notes of the runner name – and it is written here field by field rather than through a value tree: the shape is known at the point of writing, so a tree would be built only to be walked again.

The reading is the other half, and a test is what asks for it: a case runs the runner, takes the report off its standard output, and asks the report what it holds. The reader answers with a tree of its own, which is small on purpose: the format has six kinds of value, and a report carries all of them.

The escaping is the one of the format: the characters that must be escaped are escaped, and every other character goes through as it is.

Structs§

Object
A builder for one JSON object.
ReadError
The reason a document could not be read.

Enums§

Read
A value of a document, read.

Functions§

read
Read a document.
write_text
Write a text as a JSON text, with the quotes.