Skip to main content

Module json

Module json 

Source
Expand description

JSON format backend (via serde_json).

Structs§

JsonDocument
Lossless JSON source document. The parsed node tree stores byte spans for every value/member, so editors can replace only the requested span while retaining untouched ordering, whitespace, escapes, and number spelling.

Functions§

append_array_item_preserving
Append one JSON array item while retaining the existing array’s trailing whitespace and all bytes outside the insertion point.
load
remove_array_item_preserving
Remove a keyed object from a JSON array without rebuilding the document.
save
set_preserving
Set a JSON value at path while retaining every byte outside the edited region. JSON has no comments, but this still preserves key order, whitespace, line endings, escapes, and untouched number spellings.
unset_preserving
Remove one existing JSON member or array item while preserving the rest of the source layout. Removing the root value is intentionally unsupported.