pub enum TokenKind {
Show 36 variants
Unknown,
Literal {
kind: LiteralKind,
},
Whitespace,
Ident,
Semi,
Eof,
Slash,
LineComment,
BlockComment {
terminated: bool,
},
Minus,
Colon,
Dot,
Eq,
Gt,
And,
Lt,
Bang,
Plus,
Tilde,
Pound,
Question,
Or,
Percent,
Caret,
Star,
Backtick,
At,
CloseBracket,
OpenBracket,
CloseCurly,
OpenCurly,
CloseParen,
OpenParen,
Comma,
PositionalParam {
trailing_junk_start: u32,
},
QuotedIdent {
terminated: bool,
uescape: bool,
},
}Variants§
Unknown
Used when there’s an error of some sort while lexing.
Literal
Examples: 12u8, 1.0e-40, b"123". Note that _ is an invalid
suffix, but may be present here on string and numeric literals. Users of
this type will need to check for and reject that case.
See LiteralKind for more details.
Fields
§
kind: LiteralKindWhitespace
Space, tab, newline, carriage return, vertical tab, form feed
Ident
Identifier
case-sensitive
Semi
;
Eof
End of file
Slash
/
LineComment
-- foo
BlockComment
/*
foo
*/Minus
-
Colon
:
Dot
.
Eq
=
Gt
>
And
&
Lt
<
Bang
!
Plus
+
Tilde
~
Pound
#
Question
?
Or
|
Percent
%
Caret
^
Star
*
Backtick
`
At
@
CloseBracket
]
OpenBracket
[
CloseCurly
}
OpenCurly
{
CloseParen
)
OpenParen
(
Comma
,
PositionalParam
Positional Parameter, e.g., $1
see: https://www.postgresql.org/docs/16/sql-expressions.html#SQL-EXPRESSIONS-PARAMETERS-POSITIONAL
QuotedIdent
Quoted Identifier, e.g., "update" in update "my_table" set "a" = 5;
These are case-sensitive, unlike TokenKind::Ident
see: https://www.postgresql.org/docs/16/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
Trait Implementations§
impl Copy for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKind
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