pub struct TqlParser { /* private fields */ }Expand description
Main TQL parser
Implementations§
Source§impl TqlParser
impl TqlParser
Sourcepub const MAX_QUERY_DEPTH: usize = 50usize
pub const MAX_QUERY_DEPTH: usize = 50usize
Maximum query depth (matches Python implementation)
Sourcepub fn with_max_depth(max_depth: usize) -> Self
pub fn with_max_depth(max_depth: usize) -> Self
Create a new parser with custom max depth
Sourcepub fn parse(&self, query: &str) -> Result<AstNode>
pub fn parse(&self, query: &str) -> Result<AstNode>
Parse a TQL query string into an AST
§Arguments
query- The TQL query string to parse
§Returns
An AST node representing the parsed query
§Errors
Returns a TqlError if the query has invalid syntax or exceeds max depth
§Examples
ⓘ
use tql::parser::TqlParser;
let parser = TqlParser::new();
let ast = parser.parse("field eq 'value'").unwrap();Trait Implementations§
Auto Trait Implementations§
impl Freeze for TqlParser
impl RefUnwindSafe for TqlParser
impl Send for TqlParser
impl Sync for TqlParser
impl Unpin for TqlParser
impl UnwindSafe for TqlParser
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