pub struct Dfs<O = OverData>where
O: Over,{ /* private fields */ }
Expand description
A (pre-order) depth first search traverser (Wikipedia).
A traverser can be created once and used to traverse over trees multiple times without requiring additional memory allocation.
§Construction
A depth first traverser can be created,
- either by using Default trait and providing its two generic type parameters
Dfs::<_, OverData>::default()
orDfs::<_, OverDepthSiblingIdxData>::default()
, orDfs::<Dyn<u64>, OverData>::default()
orDfs::<Dary<2, String>, OverDepthSiblingIdxData>::default()
if we want the complete type signature.
- or by using the
Traversal
type.Traversal.dfs()
orTraversal.dfs().with_depth().with_sibling_idx()
.
Trait Implementations§
Source§impl<O> Traverser<O> for Dfs<O>where
O: Over,
impl<O> Traverser<O> for Dfs<O>where
O: Over,
Source§type IntoOver<O2> = Dfs<O2>
where
O2: Over
type IntoOver<O2> = Dfs<O2> where O2: Over
Transformed version of the traverser from creating iterators over
O
to O2
.Source§fn transform_into<O2: Over>(self) -> Self::IntoOver<O2>
fn transform_into<O2: Over>(self) -> Self::IntoOver<O2>
Consumes this traverser and returns a transformed version of it
which creates iterators over
O2
rather than O2
.Source§fn over_data(self) -> Self::IntoOver<O::IntoOverData>
fn over_data(self) -> Self::IntoOver<O::IntoOverData>
Returns the transformed version of the traverser where it yields: Read more
Source§fn over_nodes(self) -> Self::IntoOver<O::IntoOverNode>
fn over_nodes(self) -> Self::IntoOver<O::IntoOverNode>
Returns the transformed version of the traverser where it yields: Read more
Source§fn with_depth(self) -> Self::IntoOver<O::IntoWithDepth>
fn with_depth(self) -> Self::IntoOver<O::IntoWithDepth>
Returns the transformed version of the traverser where it yields: Read more
Source§fn with_sibling_idx(self) -> Self::IntoOver<O::IntoWithSiblingIdx>
fn with_sibling_idx(self) -> Self::IntoOver<O::IntoWithSiblingIdx>
Returns the transformed version of the traverser where it yields: Read more
Auto Trait Implementations§
impl<O> Freeze for Dfs<O>
impl<O> RefUnwindSafe for Dfs<O>
impl<O> Send for Dfs<O>
impl<O> Sync for Dfs<O>
impl<O> Unpin for Dfs<O>
impl<O> UnwindSafe for Dfs<O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more