Trait datafusion_common::tree_node::TreeNodeIterator
source · pub trait TreeNodeIterator: Iterator {
// Required methods
fn apply_until_stop<F: FnMut(Self::Item) -> Result<TreeNodeRecursion>>(
self,
f: F,
) -> Result<TreeNodeRecursion>;
fn map_until_stop_and_collect<F: FnMut(Self::Item) -> Result<Transformed<Self::Item>>>(
self,
f: F,
) -> Result<Transformed<Vec<Self::Item>>>;
}
Expand description
Transformation helper to process a sequence of iterable tree nodes that are siblings.
Required Methods§
sourcefn apply_until_stop<F: FnMut(Self::Item) -> Result<TreeNodeRecursion>>(
self,
f: F,
) -> Result<TreeNodeRecursion>
fn apply_until_stop<F: FnMut(Self::Item) -> Result<TreeNodeRecursion>>( self, f: F, ) -> Result<TreeNodeRecursion>
Apples f
to each item in this iterator
Visits all items in the iterator unless
f
returns an error or f
returns TreeNodeRecursion::Stop
.
§Returns
Error if f
returns an error or Ok(TreeNodeRecursion)
from the last invocation
of f
or Continue
if the iterator is empty
sourcefn map_until_stop_and_collect<F: FnMut(Self::Item) -> Result<Transformed<Self::Item>>>(
self,
f: F,
) -> Result<Transformed<Vec<Self::Item>>>
fn map_until_stop_and_collect<F: FnMut(Self::Item) -> Result<Transformed<Self::Item>>>( self, f: F, ) -> Result<Transformed<Vec<Self::Item>>>
Apples f
to each item in this iterator
Visits all items in the iterator unless
f
returns an error or f
returns TreeNodeRecursion::Stop
.
§Returns
Error if f
returns an error
Ok(Transformed) such that:
transformed
is true if any return fromf
had transformed truedata
from the last invocation off
tnr
from the last invocation off
orContinue
if the iterator is empty
Object Safety§
This trait is not object safe.