Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/plans/visitor/mod.rs
6940 views
1
//! Defines different visitor patterns and for any tree.
2
3
use arrow::legacy::error::PolarsResult;
4
mod expr;
5
#[cfg(feature = "cse")]
6
mod hash;
7
mod lp;
8
mod visitors;
9
10
pub use expr::*;
11
pub use lp::*;
12
pub use visitors::*;
13
14
/// Controls how the [`TreeWalker`] recursion should proceed for [`TreeWalker::visit`].
15
#[derive(Debug)]
16
pub enum VisitRecursion {
17
/// Continue the visit to this node tree.
18
Continue,
19
/// Keep recursive but skip applying op on the children
20
Skip,
21
/// Stop the visit to this node tree.
22
Stop,
23
}
24
25
/// Controls how the [`TreeWalker`] recursion should proceed for [`TreeWalker::rewrite`].
26
#[derive(Debug)]
27
pub enum RewriteRecursion {
28
/// Continue the visit to this node and children.
29
MutateAndContinue,
30
/// Don't mutate this node, continue visiting the children
31
NoMutateAndContinue,
32
/// Stop and return.
33
/// This doesn't visit the children
34
Stop,
35
/// Call `op` immediately and return
36
/// This doesn't visit the children
37
MutateAndStop,
38
}
39
40