pub struct ParseError<'a>(/* private fields */);Expand description
Parse error for one SQLite statement.
Includes diagnostics you can show directly to users:
- Error class (
kind(): recovered vs fatal). - Error message (
message()). - Optional location (
offset()/length()). - Optional partial recovery tree (
recovery_root()).
Implementations§
Source§impl<'a> ParseError<'a>
impl<'a> ParseError<'a>
Sourcepub fn kind(&self) -> ParseErrorKind
pub fn kind(&self) -> ParseErrorKind
Whether parsing recovered (Recovered) or fully failed (Fatal).
Sourcepub fn is_recovered(&self) -> bool
pub fn is_recovered(&self) -> bool
True if this error was recovered and yielded a partial tree.
Sourcepub fn recovery_root(&'a self) -> Option<Stmt<'a>>
pub fn recovery_root(&'a self) -> Option<Stmt<'a>>
Partial AST recovered from invalid input, if available.
Mirrors C syntaqlite_result_recovery_root for PARSE_ERROR.
Sourcepub fn parse_source(&self) -> &'a str
pub fn parse_source(&self) -> &'a str
The source text bound to this result.
Sourcepub fn tokens(&self) -> impl Iterator<Item = ParserToken<'a>>
pub fn tokens(&self) -> impl Iterator<Item = ParserToken<'a>>
Tokens collected during the (partial) parse, if collect_tokens was enabled.