ntree_rs/traversal/
mod.rs

1use crate::{Node, Synchronous};
2
3mod traverse;
4pub use traverse::*;
5
6mod traverse_mut;
7pub use traverse_mut::*;
8
9mod traverse_owned;
10pub use traverse_owned::*;
11
12mod macros;
13#[cfg(feature = "async")]
14mod macros_async;
15
16impl<'a, T> Node<T> {
17    /// Returns a synchronous instance of [Traverse] for the given reference of node.
18    pub fn traverse(&'a self) -> Traverse<'a, T, Synchronous> {
19        self.into()
20    }
21
22    /// Returns a synchronous instance of [TraverseMut] for the given mutable reference of node.
23    pub fn traverse_mut(&'a mut self) -> TraverseMut<'a, T, Synchronous> {
24        self.into()
25    }
26
27    /// Returns a synchronous instance of [TraverseOwned] owning the given instance of node.
28    pub fn into_traverse(self) -> TraverseOwned<T, Synchronous> {
29        self.into()
30    }
31}