Expand description
TODO move this to the structs
When JsonObject or JsonArray instances go out of scope, they write their respective closing
brackets automatically (although they also have optional end() functions). This is
convenient, but it means there is no explicit function call for returning potential
io::Errors. These errors are stored internally so they don’t get lost, and the JsonWriter
has a flush() function that returns such an error if it exists. The idiom is the same that
e.g. the standard library’s BufRead uses.
Structs§
- Json
Array - A JsonArray is the API for writing a JSON array, i.e. a sequence of elements. The
closing
]is written when the JsonArray instance goes out of scope, or when itsend()function is called. - Json
Object - A JsonObject is the API for writing a JSON object, i.e. a sequence of key/value pairs. The
closing
}is written when the JsonObject instance goes out of scope, or when itsend()function is called. - Json
Reader - A JsonReader wraps a sequence of bytes, aggregating them into a sequence of JSON tokens. It is in essentially a tokenizer, adding some rudimentary convenience for JSON’s grammar.
- Json
Writer - JsonWriter is the starting point for serializing JSON with this library. It is a thin wrapper around a [Write], adding some JSON specifics and also formatting.
Traits§
- Blocking
Read - BlockingRead is the library’s abstraction for blocking read I/O.
- Blocking
Write - BlockingWrite is the library’s abstraction for blocking write I/O.