pub enum TokenKind {
Show 35 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,
CloseParen,
OpenParen,
Comma,
UnknownPrefix,
PositionalParam,
QuotedIdent {
terminated: 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 float 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
[
CloseParen
)
OpenParen
(
Comma
,
UnknownPrefix
Error case that we need to report later on.
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 UnwindSafe for TokenKind
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)