Skip to main content

Module serialize

Module serialize 

Source
Expand description

Canonical (deterministic) JSON serialization. Object keys come out alphabetically (serde_json::Value is backed by a BTreeMap) and the nodes/edges arrays are sorted by a stable key, so unchanged input is byte-identical across runs. Generic over any Serialize — depends on nothing else in the crate.

Functions§

to_canonical_string
Compact counterpart of to_canonical_string_pretty.
to_canonical_string_pretty
Serialize to canonical pretty JSON: object keys come out alphabetically (serde_json::Value is backed by a BTreeMap), and the nodes/edges arrays are sorted by a stable key so unchanged input is byte-identical.