pub enum Lexeme<'src> {
Show 14 variants
Scalar {
span: Span,
value: Cow<'src, str>,
kind: ScalarKind,
},
Unit {
span: Span,
},
Tag {
span: Span,
name: &'src str,
has_payload: bool,
},
ObjectStart {
span: Span,
},
ObjectEnd {
span: Span,
},
SeqStart {
span: Span,
},
SeqEnd {
span: Span,
},
AttrKey {
span: Span,
key_span: Span,
key: &'src str,
},
Comma {
span: Span,
},
Newline {
span: Span,
},
Comment {
span: Span,
text: &'src str,
},
DocComment {
span: Span,
text: &'src str,
},
Eof,
Error {
span: Span,
message: &'static str,
},
}Expand description
A lexeme produced by the Lexer from raw tokens.
Variants§
Scalar
A scalar value (bare, quoted, raw, or heredoc)
Unit
Unit value: standalone @
Tag
A tag: @name
The payload (if any) comes as the next lexeme
Fields
ObjectStart
Start of object {
ObjectEnd
End of object }
SeqStart
Start of sequence (
SeqEnd
End of sequence )
AttrKey
An attribute key key> - value follows as next lexeme(s)
Fields
Comma
Comma separator
Newline
Newline (significant for separator detection)
Comment
Line comment // ...
DocComment
Doc comment /// ...
Eof
End of input
Error
Tokenizer error
Implementations§
Trait Implementations§
impl<'src> StructuralPartialEq for Lexeme<'src>
Auto Trait Implementations§
impl<'src> Freeze for Lexeme<'src>
impl<'src> RefUnwindSafe for Lexeme<'src>
impl<'src> Send for Lexeme<'src>
impl<'src> Sync for Lexeme<'src>
impl<'src> Unpin for Lexeme<'src>
impl<'src> UnsafeUnpin for Lexeme<'src>
impl<'src> UnwindSafe for Lexeme<'src>
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
Mutably borrows from an owned value. Read more