Skip to main content

satisfies_predicates

Function satisfies_predicates 

Source
pub fn satisfies_predicates(
    query: &Query,
    m: &QueryMatch<'_, '_>,
    source: &[u8],
) -> bool
Expand description

Return true if all predicates on m’s pattern are satisfied, false otherwise.

Supported predicates:

  • #match? — captured text must match the regex
  • #not-match? — captured text must not match the regex
  • #eq? — two captures/strings must be equal
  • #not-eq? — two captures/strings must not be equal

Unknown predicates pass (return true) so future predicates don’t break existing queries.