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§

source

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

source

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:

  1. transformed is true if any return from f had transformed true
  2. data from the last invocation of f
  3. tnr from the last invocation of f or Continue if the iterator is empty

Object Safety§

This trait is not object safe.

Implementors§