Function style::driver::traverse_dom

source ·
pub fn traverse_dom<E, D>(
    traversal: &D,
    token: PreTraverseToken<E>,
    pool: Option<&ThreadPool>
) -> Ewhere
    E: TElement,
    D: DomTraversal<E>,
Expand description

Do a DOM traversal for top-down and (optionally) bottom-up processing, generic over D.

We use an adaptive traversal strategy. We start out with simple sequential processing, until we arrive at a wide enough level in the DOM that the parallel traversal would parallelize it. If a thread pool is provided, we then transfer control over to the parallel traversal.

Returns true if the traversal was parallel, and also returns the statistics object containing information on nodes traversed (on nightly only). Not all of its fields will be initialized since we don’t call finish().