Module json_serde

Module json_serde 

Source
Expand description

JSON serialization helpers for the string-pool export/import feature.

These functions are used by the CLI (main.rs) for the --stringblocks-file option. Keeping them here (instead of in main.rs) makes them unit-testable.

Functions§

export_stringblocks
Serialize a string pool as a JSON object { "0": "…", "1": "…", … }.
import_stringblocks
Populate a string pool from a JSON object previously produced by export_stringblocks.
json_escape
Escape a string for safe embedding inside a JSON double-quoted value.
json_unescape
Unescape a JSON double-quoted string value (inverse of json_escape).