pub fn serialize_dedup_shared<T>(f: impl FnOnce() -> T) -> TExpand description
Runs f with a fresh shared-node deduplication scope for serialization.
Any SharedNode serialized inside f will be tracked; the first occurrence
emits the full subtree while later occurrences emit a {"$shared_ref": id}
back-reference. The tracking state is restored when f returns or panics.