Trait polars_plan::logical_plan::visitor::TreeWalker
source · pub trait TreeWalker: Sized {
// Required methods
fn apply_children(
&self,
op: &mut dyn FnMut(&Self) -> PolarsResult<VisitRecursion>
) -> PolarsResult<VisitRecursion>;
fn map_children(
self,
op: &mut dyn FnMut(Self) -> PolarsResult<Self>
) -> PolarsResult<Self>;
// Provided methods
fn visit(
&self,
visitor: &mut dyn Visitor<Node = Self>
) -> PolarsResult<VisitRecursion> { ... }
fn rewrite(
self,
rewriter: &mut dyn RewritingVisitor<Node = Self>
) -> PolarsResult<Self> { ... }
}
Expand description
An implementor of this trait decides how and in which order its nodes get traversed
Implemented for crate::dsl::Expr
and AexprNode
.
Required Methods§
fn apply_children( &self, op: &mut dyn FnMut(&Self) -> PolarsResult<VisitRecursion> ) -> PolarsResult<VisitRecursion>
fn map_children( self, op: &mut dyn FnMut(Self) -> PolarsResult<Self> ) -> PolarsResult<Self>
Provided Methods§
sourcefn visit(
&self,
visitor: &mut dyn Visitor<Node = Self>
) -> PolarsResult<VisitRecursion>
fn visit( &self, visitor: &mut dyn Visitor<Node = Self> ) -> PolarsResult<VisitRecursion>
Walks all nodes in depth-first-order.
fn rewrite( self, rewriter: &mut dyn RewritingVisitor<Node = Self> ) -> PolarsResult<Self>
Object Safety§
This trait is not object safe.