Expand description
§Error Handling
Error types and diagnostics for parsing and rendering, with source location tracking.
§Document path anchors
A Diagnostic carries two independent “where” anchors, both optional:
Diagnostic::location— source-text anchor (file:line:column). Produced by parsers and backend compilers operating on raw text.Diagnostic::path— document-model anchor into the typedcrate::document::Document. Produced by schema validation and coercion, which run on the typed model after line spans are gone.
§Path grammar
path := segment ( "." field_name | "[" index "]" )*
field_name := [A-Za-z_][A-Za-z0-9_]* // card kinds use lowercase-only [a-z_][a-z0-9_]*
index := [0-9]+Because field names and card kinds are validated to charsets that exclude
., [, ], and whitespace, the dotted form round-trips unambiguously.
| Anchor | Path |
|---|---|
| Root-block field | title |
| Nested in array of objects | recipients[0].name |
| Main card body | main.body |
| Typed card (whole) | cards.indorsement[0] |
| Field on typed card | cards.indorsement[0].signature_block |
| Body on typed card | cards.indorsement[0].body |
| Card with unknown kind | cards[0] |
The cards.<kind>[<index>] form fuses card kind and document array index so
consumers receive both without a second lookup.
Re-exports§
pub use crate::document::limits::MAX_YAML_DEPTH;
Structs§
- Diagnostic
- Structured diagnostic information.
- Location
- Render
Result
Enums§
- Parse
Error - Render
Error - Main error type for rendering operations.
- Severity
Constants§
- MAX_
CARD_ COUNT - Maximum number of card blocks allowed per document
- MAX_
FIELD_ COUNT - Maximum number of fields allowed per document
- MAX_
INPUT_ SIZE - Maximum input size for markdown (10 MB)
- MAX_
NESTING_ DEPTH - Maximum nesting depth for markdown structures (100 levels)
- MAX_
YAML_ SIZE - Maximum YAML size (1 MB)