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

Method map_elements

datafusion/common/src/tree_node.rs:809–822  ·  view source on GitHub ↗
(
        mut self,
        f: F,
    )

Source from the content-addressed store, hash-verified

807 }
808
809 fn map_elements<F: FnMut(T) -> Result<Transformed<T>>>(
810 mut self,
811 f: F,
812 ) -> Result<Transformed<Self>> {
813 // Rewrite in place so the existing heap allocation can be reused.
814 // `mem::take` hands the inner `C` to `f` while leaving
815 // `C::default()` in the slot, so an unwinding drop finds a valid
816 // `C` even if `f` panics or the `?` short-circuits.
817 let inner = std::mem::take(&mut *self);
818 Ok(inner.map_elements(f)?.update_data(|c| {
819 *self = c;
820 self
821 }))
822 }
823}
824
825impl<'a, T: 'a, C: TreeNodeContainer<'a, T> + Clone + Default> TreeNodeContainer<'a, T>

Calls 6

newFunction · 0.85
update_dataMethod · 0.80
map_dataMethod · 0.80
transform_siblingMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45