Skip to main content

Visitor

Trait Visitor 

Source
pub trait Visitor {
    // Provided methods
    fn visit_expression(&mut self, expression: Expression) -> Result<Expression> { ... }
    fn visit_table_reference(&mut self, reference: Table) -> Result<Table> { ... }
    fn visit_select(&mut self, select: Select) -> Result<Select> { ... }
}
Expand description

Inspects or rewrites the nodes a Walker visits: each method gets a node (its children already walked) and returns it, or its replacement. The defaults keep every node.

PHP: the Utopia\Query\AST\Visitor interface.

Provided Methods§

Source

fn visit_expression(&mut self, expression: Expression) -> Result<Expression>

Visits an expression.

PHP: Visitor::visitExpression().

Source

fn visit_table_reference(&mut self, reference: Table) -> Result<Table>

Visits a table reference (of a FROM or a join).

PHP: Visitor::visitTableReference().

Source

fn visit_select(&mut self, select: Select) -> Result<Select>

Visits a statement, after everything in it (subqueries included).

PHP: Visitor::visitSelect().

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<V: Visitor + ?Sized> Visitor for &mut V

Source§

fn visit_expression(&mut self, expression: Expression) -> Result<Expression>

Source§

fn visit_table_reference(&mut self, reference: Table) -> Result<Table>

Source§

fn visit_select(&mut self, select: Select) -> Result<Select>

Implementors§