pub struct Parser { /* private fields */ }Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse_expr(&mut self) -> Result<Expr, ParseError>
pub fn parse_expr(&mut self) -> Result<Expr, ParseError>
Parse a single SQL expression.
Source§impl Parser
impl Parser
pub fn new(tokens: Vec<Token>) -> Self
pub fn from_sql(sql: &str) -> Self
pub fn parse_all(&mut self) -> (Vec<Statement>, Vec<ParseError>)
pub fn parse_statement(&mut self) -> Result<Statement, ParseError>
Sourcepub fn parse_next_statement_with_tail(
&mut self,
) -> Result<Option<(Statement, usize)>, ParseError>
pub fn parse_next_statement_with_tail( &mut self, ) -> Result<Option<(Statement, usize)>, ParseError>
Parse the next top-level statement and return its ending byte offset in
the original token source, including its terminating semicolon if any.
Empty statements and comments are skipped; exhausted input returns None.
Reusing this cursor avoids tokenizing a batch’s remaining suffix for each statement. Callers must stop on an error; this method does not recover.
pub fn errors(&self) -> &[ParseError]
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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