blockworx/schema/mod.rs
1//! The on-disk document representation: JSON is the one document format
2//! (D13), and [`model::Document`] is the single source of truth for it —
3//! serde's derives on those structs *are* the codec, both directions.
4//! The schema holds only information that cannot be reconstructed — route
5//! ids and wire geometry (edges, positions, crossings) are recomputed after
6//! load and live only in memory.
7//!
8//! [`lower`] is the bridge from a parsed file to the commit log that builds
9//! it, and [`project`] is its inverse, from the folded document back to
10//! these structs — written in log order, so a document a session edits
11//! diffs by what changed (D11).
12//!
13//! `SchemaError` carries the source text (for `miette` diagnostics), so it is
14//! large by design — the internal `Result`s accept that rather than boxing.
15#![allow(clippy::result_large_err)]
16
17pub mod enums;
18pub mod error;
19pub mod loc;
20pub mod lower;
21pub mod model;
22pub mod project;
23
24#[cfg(test)]
25mod roundtrip;
26#[cfg(test)]
27mod tests;
28
29pub use error::SchemaError;