panproto-protocols
Built-in protocol definitions for panproto.
Each of the 50 protocols is defined by a schema theory GAT and an instance theory GAT, composed via colimit from 27 reusable building-block theories organized in six groups. This crate includes parsers for each protocol's native schema format.
Programming language and data format parsing (previously handled by hand-written protocol parsers for SQL, Protobuf, GraphQL, and others) is now handled by tree-sitter grammars in panproto-parse. The protocols that remain here are semantic protocols: annotation formats, domain-specific schemas, and formats that have no tree-sitter grammar.
Protocols
| Protocol | Schema type | Instance type | Parser |
|---|---|---|---|
| ATProto | Constrained multigraph | W-type | Lexicon JSON |
| OpenAPI | Constrained multigraph | W-type | YAML/JSON |
| WASI | Simple graph | Flat | WIT |
| Cap'n Proto | Simple graph | Flat | .capnp files |
| ...and 46 more |
See the protocol catalog for the full list.
Building-Block Theories (27)
Protocols compose their schema and instance theories from reusable building blocks via colimit:
| Group | Theories |
|---|---|
| A: Core graphs | ThGraph, ThSimpleGraph, ThHypergraph, ThConstraint, ThMulti, ThInterface |
| B: Instance shapes | ThWType, ThMeta, ThFunctor, ThFlat |
| C: Structure | ThOrder, ThCoproduct, ThRecursion, ThSpan, ThCospan, ThPartial, ThLinear, ThNominal |
| D: Symmetry | ThReflexiveGraph, ThSymmetricGraph |
| E: Process | ThPetriNet, ThCausal |
| F: Composition | ThGraphInstance, ThAnnotation, ThOperad, ThTracedMonoidal, ThSimplicial |
API
| Item | Description |
|---|---|
atproto / openapi / wasi / capnp / ... |
Protocol modules with definitions, parsers, and theory registration |
theories |
All 27 building-block theory definitions |
ProtocolError |
Error type |
Example
use atproto;
let protocol = protocol;
let schema = parse_lexicon?;