xuanji 0.2.3

璇璣 (Xuanji) — the shared reaction model of Tianheng: Severity, Violation, Report, Baseline, and Outcome — the dimension-agnostic measure every observation dimension reacts in, with the JSON serialization intrinsic to those types. serde_json-only; renders no verdict — it holds the measure, never the react itself.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Serialization and helper utilities for `xuanji`.

use serde_json::Value;

/// Serialize an owned [`Value`] to pretty JSON.
///
/// Infallible by construction: a `Value`'s `Serialize` impl does not fail for finite JSON data.
/// Fail-loud is reserved for observable misconfiguration, not unreachable states.
pub fn pretty_json(document: &Value) -> String {
    serde_json::to_string_pretty(document).expect("a serde_json::Value is always serializable")
}