pub struct RecordsToJson<S: Sink> { /* private fields */ }Expand description
Turns TableRows/1 into JsonEvents/1.
Schema opens the array, each Row is one object whose members are the
labels in schema order, End closes the array and ends the document.
The protocol is validated as the CSV renderer validates it: one schema
first, rows of the schema’s width, one end, PROTOCOL_ORDER_ERROR
otherwise. A schema with no columns is allowed, since an empty object
is a JSON value; the CSV renderer’s refusal is about CSV. When a label
repeats, each record carries it once, from the last column whose cell
contributes a member (under Skip a Missing cell contributes none),
in that column’s position: the value a reader of the un-deduplicated
record would keep, since a member that was never written cannot win.
A failure found after events were forwarded is marked as having
committed output, since the stage downstream may have rendered them.