Expand description
CGR-based Cap’n Proto schema parser.
Reads binary CodeGeneratorRequest (CGR) files produced by capnp compile
via build.rs, and produces ParsedSchema with full wire format info.
Advantages over text parsing:
- Full type resolution (struct names resolved via node graph)
- Native annotation extraction (no text stripping hacks)
- Deterministic output (BTreeMap for node ordering)
- Wire format offsets (data_words, pointer_words, slot_offset) for codegen
- Discriminant values available directly
Constants§
- MAXLEN_
ZERO_ CONTRACT_ ERROR - Build a
FieldDeffrom aSlotfield reader.
Functions§
- is_
primitive_ type - Check if a type name is a primitive (not a struct reference).
- parse_
from_ cgr - Parse a schema from a CGR binary file in OUT_DIR (for proc-macro use).
- parse_
from_ cgr_ path - Parse a schema from a CGR binary file at a given path.