Enum yaml_rust2::scanner::TokenType
source · pub enum TokenType {
Show 21 variants
StreamStart(TEncoding),
StreamEnd,
VersionDirective(u32, u32),
TagDirective(String, String),
DocumentStart,
DocumentEnd,
BlockSequenceStart,
BlockMappingStart,
BlockEnd,
FlowSequenceStart,
FlowSequenceEnd,
FlowMappingStart,
FlowMappingEnd,
BlockEntry,
FlowEntry,
Key,
Value,
Alias(String),
Anchor(String),
Tag(String, String),
Scalar(TScalarStyle, 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(String, String)
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 array ([ a, b ]
).
FlowSequenceEnd
End of an inline array.
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(String)
A reference to an anchor.
Anchor(String)
A YAML anchor (&
/*
).
Tag(String, String)
A YAML tag (starting with bangs !
).
Scalar(TScalarStyle, String)
A regular YAML scalar.