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

Method transform_parent

datafusion/common/src/tree_node.rs:764–775  ·  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 parent.

(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

762 /// current [`TreeNodeRecursion`] value and the fact that `f` is changing the current
763 /// node's parent.
764 pub fn transform_parent<F: FnOnce(T) -> Result<Transformed<T>>>(
765 self,
766 f: F,
767 ) -> Result<Transformed<T>> {
768 match self.tnr {
769 TreeNodeRecursion::Continue => f(self.data).map(|mut t| {
770 t.transformed |= self.transformed;
771 t
772 }),
773 TreeNodeRecursion::Jump | TreeNodeRecursion::Stop => Ok(self),
774 }
775 }
776}
777
778/// [`TreeNodeContainer`] contains elements that a function can be applied on or mapped.

Callers 2

transform_up_implMethod · 0.80

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected