datafusion_common::tree_node

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§