pub struct Lexer<'a> { /* private fields */ }Expand description
The lexer. It gives one token for each call of Lexer::next_token.
Implementations§
Source§impl<'a> Lexer<'a>
impl<'a> Lexer<'a>
Sourcepub fn new(text: &'a str) -> Lexer<'a>
pub fn new(text: &'a str) -> Lexer<'a>
A lexer for text. The text ends at the first zero byte, as the C string that PostgreSQL gets does.
Sourcepub fn take_notices(&mut self) -> Vec<Notice>
pub fn take_notices(&mut self) -> Vec<Notice>
Takes the notices that the tokens until now gave.
Sourcepub fn next_token(&mut self) -> Result<Token<'a>, Error>
pub fn next_token(&mut self) -> Result<Token<'a>, Error>
The next token. After the last token it gives the end, token 0, again and again.
Trait Implementations§
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