Skip to main content

Crate panproto_schema

Crate panproto_schema 

Source
Expand description

§panproto-schema

Schema representation for panproto.

A schema is a model of a protocol’s schema theory GAT (from panproto-gat). This crate provides:

  • Schema: The core schema data structure with precomputed adjacency indices for efficient graph traversal.
  • SchemaBuilder: A fluent, protocol-aware builder that validates each element as it is added.
  • Protocol: Configuration describing which schema/instance theories and edge rules a data format uses.
  • normalize: Ref-chain collapse for schemas with Ref vertices.
  • validate: Post-hoc validation of a schema against a protocol.

Re-exports§

pub use equivalence::edge_multiset;
pub use equivalence::kind_multiset;

Modules§

equivalence
Kind-multiset witnesses for schema equivalence under round-tripping.
serde_helpers
Custom serde helpers for JSON-compatible serialization of complex map keys.

Structs§

AbstractSchema
A schema with no layout enrichment.
CoercionSpec
Specification of a coercion between two value kinds.
Constraint
A constraint on a vertex.
DecoratedSchema
A schema carrying a complete layout enrichment over its abstract content.
Edge
A binary edge between two vertices.
EdgeRule
A well-formedness rule for edges of a given kind.
HyperEdge
A hyper-edge (present only when the schema theory includes ThHypergraph).
LayoutConstraintsPresent
Returned by AbstractSchema::from_layout_free when the input schema carries constraints in the layout enrichment fibre and therefore cannot be treated as abstract.
LayoutWitness
Per-vertex view of the layout witness data carried by a DecoratedSchema.
Ordering
An ordering annotation on an edge.
Protocol
Identifies the schema and instance theories for a data-format protocol, together with structural well-formedness rules.
RecursionPoint
A recursion point (fixpoint marker) in the schema.
Schema
A schema: a model of the protocol’s schema theory.
SchemaBuilder
A builder for incrementally constructing a validated Schema.
SchemaMorphism
An explicit schema morphism (functor F: S → T).
SchemaOverlap
Specifies which elements of two schemas are identified (shared).
Span
A span connecting two vertices through a common source.
Variant
A variant in a coproduct (sum type / union).
Vertex
A schema vertex.

Enums§

SchemaError
Errors that can occur during schema construction and validation.
UsageMode
Use-counting mode for an edge.
ValidationError
An error found during schema validation against a protocol.

Functions§

normalize
Collapse ref-chains in a schema into direct edges.
primary_entry
Choose a single entry vertex for a schema.
schema_pushout
Compute the pushout (colimit) of two schemas along their overlap.
validate
Validate a schema against a protocol’s structural rules.