Expand description
JSON ⇄ C0DATA conversion.
The intermediate Value tree and the to_value/from_value
conversions are dependency-free and always available. The JSON text
helpers ([to_json]/[from_json]) need the json feature, which pulls
in serde_json.
Export never guesses: a positional record is an array, a keyed record
an object, a group with a header row an array of objects, a reference
{"$ref": "group/record/field"}.
Enums§
- Value
- An intermediate data tree. All scalars are strings; objects keep insertion order.
Functions§
- export_
body - A body:
{file => groups}per named file, or the groups directly; a bare body (one unnamed group) exports as that group. - export_
group - A group: with a header row, an array of objects; a single keyed record is an object; otherwise an array of its records.
- export_
record - A record: a keyed record is an object (last value wins for a duplicate key), a positional one an array.
- from_
value - Emit a
Valuetree as canonical C0DATA bytes. An object of groups becomes groups (one key wrapping an object of groups becomes a file); an array becomes one group namedgroup_name; an object of scalars one group holding one map; a scalar one record. - to_
value - Build a
Valuetree from C0DATA bytes (the first document’s body).