pub struct ChildAncestors<'tree, 'chain> { /* private fields */ }Expand description
The chain of a node’s children, held by a consumer that reads them
without descending: what Ancestors::of_children builds. A
consumer that does descend, into wrappers whose statements it reads
as the body’s own, moves it with descend and
ascend rather than building one per level.
Implementations§
Source§impl<'tree> ChildAncestors<'tree, '_>
impl<'tree> ChildAncestors<'tree, '_>
Sourcepub fn get(&self) -> Ancestors<'tree, '_>
pub fn get(&self) -> Ancestors<'tree, '_>
The children’s Ancestors, with the walk’s fold cache carried
and its sibling cache deliberately not — the children are nodes
the walk has not recorded.
Sourcepub fn descend(&mut self, child: &Node<'tree>)
pub fn descend(&mut self, child: &Node<'tree>)
Descends into child, one of the nodes this chain describes, so
that get answers for its children; undone by
ascend. A consumer that reads a body’s
statements through the wrappers they sit in — Ruby’s npm under
an if, a begin, a call’s argument list — keeps one chain and
moves it, where building a fresh Ancestors::of_children at
each level copies the whole chain per level, O(depth) each and
all of them live at once (#1401 review). Without a known chain
there is nothing to move and the answers keep climbing.