pub struct QueryInterpreter<'q, 'tree> { /* private fields */ }Expand description
Query interpreter that executes a compiled query against an AST.
Implementations§
Source§impl<'q, 'tree> QueryInterpreter<'q, 'tree>
impl<'q, 'tree> QueryInterpreter<'q, 'tree>
Sourcepub fn new(
query: &'q CompiledQuery,
cursor: TreeCursor<'tree>,
source: &'tree str,
) -> Self
pub fn new( query: &'q CompiledQuery, cursor: TreeCursor<'tree>, source: &'tree str, ) -> Self
Creates a new interpreter.
The cursor should be positioned at the tree root.
Sourcepub fn with_exec_fuel(self, fuel: u32) -> Self
pub fn with_exec_fuel(self, fuel: u32) -> Self
Set execution fuel limit.
Sourcepub fn with_recursion_fuel(self, fuel: u32) -> Self
pub fn with_recursion_fuel(self, fuel: u32) -> Self
Set recursion fuel limit.
Sourcepub fn run(self) -> Result<Value<'tree>, RuntimeError>
pub fn run(self) -> Result<Value<'tree>, RuntimeError>
Run the query and return the result.
Sourcepub fn run_from(self, start: TransitionId) -> Result<Value<'tree>, RuntimeError>
pub fn run_from(self, start: TransitionId) -> Result<Value<'tree>, RuntimeError>
Run the query from a specific transition and return the result.