pub struct EventMeta<'input> {
pub anchor: Option<&'input str>,
pub anchor_loc: Option<Span>,
pub tag: Option<Cow<'input, str>>,
pub tag_loc: Option<Span>,
}Expand description
Rare per-event fields for node-typed events (Scalar, SequenceStart, MappingStart).
Bundled behind Option<Box<EventMeta>> so that the common case — no anchor, no
source-text tag — pays only one 8-byte pointer instead of ~96 bytes of inline storage.
Events with tags and anchors are rare in block-heavy and Kubernetes YAML; boxing them
moves the cost to the uncommon path.
Fields§
§anchor: Option<&'input str>The anchor name, if any (e.g. &foo).
anchor_loc: Option<Span>Source span of the &name anchor token — from & through the last byte of the name.
Some when anchor is Some, None otherwise.
tag: Option<Cow<'input, str>>The resolved tag, if any (e.g. "tag:yaml.org,2002:str" for !!str).
Verbatim tags (!<URI>) borrow from input. Shorthand tags resolved via %TAG
directives or the built-in !! default produce owned strings.
tag_loc: Option<Span>Source span of the tag token — from ! through the last byte of the tag token.
Some when tag is Some, None otherwise.