panproto_schema/lib.rs
1//! # panproto-schema
2//!
3//! Schema representation for panproto.
4//!
5//! A schema is a model of a protocol's schema theory GAT (from
6//! `panproto-gat`). This crate provides:
7//!
8//! - **[`Schema`]**: The core schema data structure with precomputed
9//! adjacency indices for efficient graph traversal.
10//! - **[`SchemaBuilder`]**: A fluent, protocol-aware builder that
11//! validates each element as it is added.
12//! - **[`Protocol`]**: Configuration describing which schema/instance
13//! theories and edge rules a data format uses.
14//! - **[`normalize`]**: Ref-chain collapse for schemas with `Ref` vertices.
15//! - **[`validate`]**: Post-hoc validation of a schema against a protocol.
16
17mod builder;
18mod colimit;
19mod error;
20mod morphism;
21mod normalize;
22mod protocol;
23mod schema;
24pub mod serde_helpers;
25mod validate;
26
27pub use builder::SchemaBuilder;
28pub use colimit::{SchemaOverlap, schema_pushout};
29pub use error::{SchemaError, ValidationError};
30pub use morphism::SchemaMorphism;
31pub use normalize::normalize;
32pub use protocol::{EdgeRule, Protocol};
33pub use schema::{
34 CoercionSpec, Constraint, Edge, HyperEdge, Ordering, RecursionPoint, Schema, Span, UsageMode,
35 Variant, Vertex,
36};
37pub use validate::validate;