Module quantor_ext

Source
Expand description

§quantor: QuantorExt

This module defines QuantorExt, a trait that provides method-style access to all logical quantifier operations available in the quantor crate.

Instead of using the standalone functions like forall(&numbers, pred), this trait allows you to write more fluent expressions such as numbers.forall(pred) or numbers.select_where(...).

The trait is implemented for any type that can be referenced as a slice (AsRef<[T]>), making it compatible with Vec<T>, slices, arrays, and similar types.

§Included Quantifiers

  • Core: forall, exists, none, exactly_one, all_equal
  • Nested: forallexists, existsforall
  • Structured: pairwise, failing_elements
  • Selection: select_where, select_unique, select_duplicates

Enable the method-api feature to activate this module and import it via quantor::prelude::*.

§Example

use quantor::prelude::*;

let xs = vec![1, 2, 3];
assert!(xs.forall(|x| *x < 10));
assert_eq!(xs.select_where(|x| x % 2 == 0), vec![&2]);

Traits§

QuantorExt
Extension trait providing method-style quantifier logic over collections.