Trait datafusion_common::tree_node::TreeNodeRewriter
source · pub trait TreeNodeRewriter: Sized {
type N: TreeNode;
// Required method
fn mutate(&mut self, node: Self::N) -> Result<Self::N>;
// Provided method
fn pre_visit(&mut self, _node: &Self::N) -> Result<RewriteRecursion> { ... }
}
Expand description
Trait for potentially recursively transform an TreeNode
node
tree. When passed to TreeNode::rewrite
, TreeNodeRewriter::mutate
is
invoked recursively on all nodes of a tree.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn pre_visit(&mut self, _node: &Self::N) -> Result<RewriteRecursion>
fn pre_visit(&mut self, _node: &Self::N) -> Result<RewriteRecursion>
Invoked before (Preorder) any children of node
are rewritten /
visited. Default implementation returns Ok(Recursion::Continue)