Skip to main content

to_string_force_strings

Function to_string_force_strings 

Source
pub fn to_string_force_strings(value: &Value) -> Result<String>
Expand description

Render a Value with every scalar coerced to a String — typed integers (:i), typed floats (:f), booleans, and null are flattened to their textual form and emitted via the raw- marker ::. Compounds (Object / Array) preserve their structure; only leaf scalars are coerced. The output round-trips back through the parser as the same set of String scalars.

Useful for “everything is a string” dumps — e.g. for downstream consumers that don’t understand typed markers, or for diff- friendly canonical text.