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.
Trait Implementations§
impl Eq for TokenType
impl StructuralPartialEq for TokenType
Auto Trait Implementations§
impl Freeze for TokenType
impl RefUnwindSafe for TokenType
impl Send for TokenType
impl Sync for TokenType
impl Unpin for TokenType
impl UnwindSafe for TokenType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)