Skip to main content

Module leaf

Module leaf 

Source
Available on crate feature parser only.
Expand description

§Leaf

The atom of the syntax tree: a single raw piece of a calendar.

Two leaf kinds split on a spec boundary. IcalLeaf wraps still-escaped text (a name, a parameter value, a line ending), US-ASCII in every version and so always valid UTF-8.

IcalValueLeaf wraps a still-escaped value component as raw bytes, because a property value may carry a foreign charset (a vCalendar 1.0 CHARSET) that is not UTF-8.

Both are a Cow, so a parsed leaf borrows the source (the basis of byte-faithful round-trips) and only becomes owned when a build or an edit replaces it.

Structs§

IcalLeaf
A single raw text piece of a calendar (a name, a parameter value, a line ending): borrowed when parsed, owned when built or edited. Always valid UTF-8, since the parser rejects a non-UTF-8 name or parameter.
IcalValueLeaf
A single raw value component of a calendar, held as raw bytes so a foreign charset survives byte for byte. Borrowed when parsed, owned when built or edited. The codec resolves these bytes to the decoded model’s UTF-8 text (lossily, when they are not UTF-8); the raw bytes stay reachable here.