MCPcopy Create free account
hub / github.com/apache/datafusion / transform_children

Method transform_children

datafusion/common/src/tree_node.rs:724–741  ·  view source on GitHub ↗

Maps the [`Transformed`] object to the result of the given `f` depending on the current [`TreeNodeRecursion`] value and the fact that `f` is changing the current node's children.

(
        mut self,
        f: F,
    )

Source from the content-addressed store, hash-verified

722 /// current [`TreeNodeRecursion`] value and the fact that `f` is changing the current
723 /// node's children.
724 pub fn transform_children<F: FnOnce(T) -> Result<Transformed<T>>>(
725 mut self,
726 f: F,
727 ) -> Result<Transformed<T>> {
728 match self.tnr {
729 TreeNodeRecursion::Continue => {
730 return f(self.data).map(|mut t| {
731 t.transformed |= self.transformed;
732 t
733 });
734 }
735 TreeNodeRecursion::Jump => {
736 self.tnr = TreeNodeRecursion::Continue;
737 }
738 TreeNodeRecursion::Stop => {}
739 }
740 Ok(self)
741 }
742
743 /// Maps the [`Transformed`] object to the result of the given `f` depending on the
744 /// current [`TreeNodeRecursion`] value and the fact that `f` is changing the current

Callers 2

transform_down_implMethod · 0.80

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected