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::Valueis backed by aBTreeMap), and thenodes/edgesarrays are sorted by a stable key so unchanged input is byte-identical.