## traverse_candidate

# Function traverse_candidate

Source

    fn traverse_candidate<'tcx, C, T, I>(
        candidate: C,
        context: &mut T,
        visit_leaf: &mut impl FnMut(C, &mut T),
        get_children: impl Copy + Fn(C, &mut T) -> I,
        complete_children: impl Copy + Fn(&mut T),
    )where
        C: Borrow<Candidate<'tcx>>,
        I: Iterator<Item = C>,

Expand description

A depth-first traversal of the `Candidate` and all of its recursive subcandidates.

This signature is very generic, to support traversing candidate trees by reference or by value, and to allow a mutable “context” to be shared by the traversal callbacks. Most traversals can use the simpler `Candidate::visit_leaves` wrapper instead.