pub struct DepthFirstTraversal<'provider> { /* private fields */ }Expand description
A depth-first walk over a subtree, in document order.
Implementations§
Source§impl<'provider> DepthFirstTraversal<'provider>
impl<'provider> DepthFirstTraversal<'provider>
Sourcepub fn new(
root: NodeState<'provider>,
root_path: &str,
descent_limit: Option<usize>,
) -> Self
pub fn new( root: NodeState<'provider>, root_path: &str, descent_limit: Option<usize>, ) -> Self
Creates a traversal of the subtree rooted at root, whose content
path is root_path (any spelling; it is normalized). A descent
limit of Some(limit) visits nodes at most limit levels below
the root; None visits the whole subtree.
Sourcepub fn next_node(&mut self) -> Result<Option<VisitedNode<'_, 'provider>>>
pub fn next_node(&mut self) -> Result<Option<VisitedNode<'_, 'provider>>>
Advances to the next node in document order, or Ok(None) when
the subtree is exhausted. The returned VisitedNode borrows the
traversal’s path buffer, so it lives until the next call.
Auto Trait Implementations§
impl<'provider> !RefUnwindSafe for DepthFirstTraversal<'provider>
impl<'provider> !Send for DepthFirstTraversal<'provider>
impl<'provider> !Sync for DepthFirstTraversal<'provider>
impl<'provider> !UnwindSafe for DepthFirstTraversal<'provider>
impl<'provider> Freeze for DepthFirstTraversal<'provider>
impl<'provider> Unpin for DepthFirstTraversal<'provider>
impl<'provider> UnsafeUnpin for DepthFirstTraversal<'provider>
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