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.
It borrows the walk’s chain and owns only the entries below it, so
it holds the walk’s Vec immutably for as long as it lives (#1805).
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 with it the visited node its word slots serve — and its
sibling cache deliberately not: the children are nodes the walk
has not recorded. Neither does an iter from
it regain the sibling cache once it climbs back into the walk’s
own chain. Forwarding the record for that climb was measured and
left out: no walk asks for a sibling there, in the suite or the
repository corpora (#1871).
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 deriving a fresh Ancestors::of_children from
the last at each level copies every level derived so far, all of
them live at once (#1401 review). Without a known chain there is
nothing to move and the answers keep climbing.