Function selectors::matching::matches_selector[][src]

pub fn matches_selector<E, F>(
    selector: &Selector<E::Impl>,
    offset: usize,
    hashes: Option<&AncestorHashes>,
    element: &E,
    context: &mut MatchingContext<'_, E::Impl>,
    flags_setter: &mut F
) -> bool where
    E: Element,
    F: FnMut(&E, ElementSelectorFlags), 

Matches a selector, fast-rejecting against a bloom filter.

We accept an offset to allow consumers to represent and match against partial selectors (indexed from the right). We use this API design, rather than having the callers pass a SelectorIter, because creating a SelectorIter requires dereferencing the selector to get the length, which adds an unncessary cache miss for cases when we can fast-reject with AncestorHashes (which the caller can store inline with the selector pointer).