Skip to main content

Module value

Module value 

Source
Expand description

Conversion between the merge IR and the native JSON/TOML value types.

Merge runs on knf_core::Value, so these fire exactly twice per run: once per layer on the way in, once on the whole document on the way out. Free functions rather than From/TryFrom impls because both sides are foreign types — impl From<toml::Value> for knf_core::Value names nothing local and does not compile.

Structs§

NullInToml
Nulls survived into a document being converted to TOML.

Functions§

from_json
JSON → IR. Total: every JSON value has an IR counterpart.
from_toml
TOML → IR. Total: datetimes keep their source spelling rather than becoming strings, which is what lets a TOML datetime survive a mixed-format merge.
replace_nulls
Substitutes placeholder for every null in the document.
to_json
IR → JSON. Total; a datetime renders as the string JSON would have to use.
to_toml
IR → TOML, rejecting nulls first.