parser only.Expand description
§Codec
The bytes-to-model bridge, in both directions and at both levels. It is the
only part of crate::tree that consults the card version.
decode projects a raw syntax tree onto the decoded model and encode
projects it back; that is the structural level. Underneath, the value-string
level: escape and unescape apply and resolve the RFC 5545 3.3.11
value escapes (keyed by the mode Escaper). The structural encoders and
decoders run every value leaf through those. Content transfer encodings
(QUOTED-PRINTABLE, BASE64) and CHARSET are never resolved here: the
core transforms no content, leaving that to the opt-in feature helpers.
The per-value-type projection is the Codec trait. One impl per value
type lives under crate::tree::value, mirroring the model’s value/, so
each value’s codec is written exactly once; both the structural dispatch and
the per-property lenses go through it.
Modules§
- decode
- Decode (syntax to model)
- encode
- Encode (model to syntax)
- escape
- Escape (write codec)
- mode
- Escaping mode
- unescape
- Unescape (read codec)
Traits§
- Codec
- How a decoded value type projects to and from a syntax node:
decodereads it from a node (itsescapercarries the mode),encodewrites it back, escaping every leaf with the givenEscaperand stamping it on the node. The escaper is symmetric across the two directions: decode reads it off the incoming node, encode receives the target mode and applies it (the decoded value itself is escaper-agnostic clean text).