pub enum TokenType<'input> {
Show 22 variants
StreamStart(TEncoding),
StreamEnd,
VersionDirective(u32, u32),
TagDirective(Cow<'input, str>, Cow<'input, str>),
DocumentStart,
DocumentEnd,
BlockSequenceStart,
BlockMappingStart,
BlockEnd,
FlowSequenceStart,
FlowSequenceEnd,
FlowMappingStart,
FlowMappingEnd,
BlockEntry,
FlowEntry,
Key,
Value,
Alias(Cow<'input, str>),
Anchor(Cow<'input, str>),
Tag(Cow<'input, str>, Cow<'input, str>),
Scalar(ScalarStyle, Cow<'input, str>),
ReservedDirective(String, Vec<String>),
}Expand description
The contents of a scanner token.
Variants§
StreamStart(TEncoding)
The start of the stream. Sent first, before even TokenType::DocumentStart.
StreamEnd
The end of the stream, EOF.
VersionDirective(u32, u32)
A YAML version directive.
TagDirective(Cow<'input, str>, Cow<'input, str>)
A YAML tag directive (e.g.: !!str, !foo!bar, …).
DocumentStart
The start of a YAML document (---).
DocumentEnd
The end of a YAML document (...).
BlockSequenceStart
The start of a sequence block.
Sequence blocks are arrays starting with a -.
BlockMappingStart
The start of a sequence mapping.
Sequence mappings are “dictionaries” with “key: value” entries.
BlockEnd
End of the corresponding BlockSequenceStart or BlockMappingStart.
FlowSequenceStart
Start of an inline sequence ([ a, b ]).
FlowSequenceEnd
End of an inline sequence.
FlowMappingStart
Start of an inline mapping ({ a: b, c: d }).
FlowMappingEnd
End of an inline mapping.
BlockEntry
An entry in a block sequence (c.f.: TokenType::BlockSequenceStart).
FlowEntry
An entry in a flow sequence (c.f.: TokenType::FlowSequenceStart).
Key
A key in a mapping.
Value
A value in a mapping.
Alias(Cow<'input, str>)
A reference to an anchor.
Anchor(Cow<'input, str>)
A YAML anchor (&/*).
Tag(Cow<'input, str>, Cow<'input, str>)
A YAML tag (starting with bangs !).
Scalar(ScalarStyle, Cow<'input, str>)
A regular YAML scalar.
ReservedDirective(String, Vec<String>)
A reserved YAML directive.