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

Method transform_sibling

datafusion/common/src/tree_node.rs:746–759  ·  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 sibling.

(
        self,
        f: F,
    )

Source from the content-addressed store, hash-verified

744 /// current [`TreeNodeRecursion`] value and the fact that `f` is changing the current
745 /// node's sibling.
746 pub fn transform_sibling<F: FnOnce(T) -> Result<Transformed<T>>>(
747 self,
748 f: F,
749 ) -> Result<Transformed<T>> {
750 match self.tnr {
751 TreeNodeRecursion::Continue | TreeNodeRecursion::Jump => {
752 f(self.data).map(|mut t| {
753 t.transformed |= self.transformed;
754 t
755 })
756 }
757 TreeNodeRecursion::Stop => Ok(self),
758 }
759 }
760
761 /// Maps the [`Transformed`] object to the result of the given `f` depending on the
762 /// current [`TreeNodeRecursion`] value and the fact that `f` is changing the current

Callers 5

map_elementsMethod · 0.80
rewrite_childrenFunction · 0.80
rewriteMethod · 0.80

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected