nb_tree/tree/iter/
mod.rs

1use crate::prelude::Path;
2
3use self::{absolute::Absolute, skip_below::SkipBelow};
4
5pub mod absolute;
6//pub mod combine;
7pub mod depth;
8pub mod skip_below;
9pub mod sortable;
10pub mod width;
11
12#[derive(Debug, PartialEq)]
13pub struct TraversalNode<N, B> {
14    pub path: Path<B>,
15    pub data: N,
16}
17
18pub trait TreeIterTools: Iterator + Sized {
19    fn absolute<B>(self) -> Absolute<Self, B> {
20        Absolute::new(self)
21    }
22
23    fn skip_below<P, B>(self, predicate: P) -> SkipBelow<Self, P, B>
24    where
25        P: FnMut(&Self::Item) -> bool,
26        Self: std::marker::Sized,
27    {
28        SkipBelow::new(self, predicate)
29    }
30}
31
32impl<T: Iterator + Sized> TreeIterTools for T {}