Skip to main content

Module error

Module error 

Source
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 typed crate::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.

AnchorPath
Root-block fieldtitle
Nested in array of objectsrecipients[0].name
Main card bodymain.body
Typed card (whole)cards.indorsement[0]
Field on typed cardcards.indorsement[0].signature_block
Body on typed cardcards.indorsement[0].body
Card with unknown kindcards[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
RenderResult

Enums§

ParseError
RenderError
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)

Functions§

print_errors