Trait datafusion_common::tree_node::ConcreteTreeNode
source · pub trait ConcreteTreeNode: Sized {
// Required methods
fn children(&self) -> &[Self];
fn take_children(self) -> (Self, Vec<Self>);
fn with_new_children(self, children: Vec<Self>) -> Result<Self>;
}
Expand description
Instead of implementing TreeNode
, it’s recommended to implement a ConcreteTreeNode
for
trees that contain nodes with payloads. This approach ensures safe execution of algorithms
involving payloads, by enforcing rules for detaching and reattaching child nodes.
Required Methods§
sourcefn take_children(self) -> (Self, Vec<Self>)
fn take_children(self) -> (Self, Vec<Self>)
Detaches the node from its children, returning the node itself and its detached children.
sourcefn with_new_children(self, children: Vec<Self>) -> Result<Self>
fn with_new_children(self, children: Vec<Self>) -> Result<Self>
Reattaches updated child nodes to the node, returning the updated node.
Object Safety§
This trait is not object safe.