pub struct Lexer<'a> { /* private fields */ }Expand description
SQL lexer that produces a stream of tokens from source text.
Implementations§
Source§impl<'a> Lexer<'a>
impl<'a> Lexer<'a>
Sourcepub fn tokenize_into(source: &'a str, tokens: &mut Vec<Token>)
pub fn tokenize_into(source: &'a str, tokens: &mut Vec<Token>)
Tokenize the entire input into a caller-owned buffer.
This preserves the buffer’s existing heap allocation across repeated
parses so statement-level callers can treat token storage as lookaside
scratch instead of rebuilding a fresh Vec<Token> on every miss.
Sourcepub fn metrics_snapshot() -> TokenizeMetricsSnapshot
pub fn metrics_snapshot() -> TokenizeMetricsSnapshot
Expose tokenize metrics as a snapshot.
Sourcepub fn reset_metrics()
pub fn reset_metrics()
Reset tokenize metrics.
Sourcepub fn next_token(&mut self) -> Token
pub fn next_token(&mut self) -> Token
Produce the next token.
Auto Trait Implementations§
impl<'a> Freeze for Lexer<'a>
impl<'a> RefUnwindSafe for Lexer<'a>
impl<'a> Send for Lexer<'a>
impl<'a> Sync for Lexer<'a>
impl<'a> Unpin for Lexer<'a>
impl<'a> UnsafeUnpin for Lexer<'a>
impl<'a> UnwindSafe for Lexer<'a>
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