kyyn-core 0.1.13

Core vocabulary for kyyn: registry, links, query AST, plugin and validation contracts for typed, git-backed knowledge bases.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Canonical on-disk RON: pretty, no struct names, unescaped strings (so
//! prose `notes` are written as real multiline text — raw strings only when the
//! content contains a `"`), trailing newline. Every writer (proposal staging,
//! schema-change rewrites) uses this so files are byte-stable and diff cleanly
//! line-by-line.

use serde::Serialize;

pub fn to_ron<T: Serialize>(value: &T) -> Result<String, ron::Error> {
    let cfg = ron::ser::PrettyConfig::default()
        .struct_names(false)
        .escape_strings(false);
    let mut s = ron::ser::to_string_pretty(value, cfg)?;
    s.push('\n');
    Ok(s)
}