Skip to main content

Module codec

Module codec 

Source
Available on crate feature parser only.
Expand description

§Codec

The bytes-to-model bridge, in both directions and at both levels. The only part of crate::tree that consults the calendar version.

decode projects a raw syntax tree onto the decoded model and encode projects it back; that is the structural level.

Underneath, at the value-string level, escape and unescape apply and resolve the RFC 5545 3.3.11 value escapes, keyed by the mode Escaper, and every value leaf the structural codecs touch runs through them.

A parameter value is a different alphabet, with no backslash escapes at all (RFC 5545 3.2) and the RFC 6868 caret encoding instead, so it has its own pair in the same two modules, keyed by the same Escaper.

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, implemented once per value type under crate::tree::value, mirroring the model’s value/; 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.