use-predicate 0.0.1

Small predicate composition helpers for RustUse
Documentation
  • Coverage
  • 14.29%
    1 out of 7 items documented1 out of 5 items with examples
  • Size
  • Source code size: 5.17 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 283.24 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-validate
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-predicate

Small predicate composition helpers for RustUse.

Install

[dependencies]
use-predicate = "0.0.1"

Foundation

use-predicate provides tiny helpers for running multiple predicates against a single value: all, any, not, and count.

Example

use use_predicate::{all, any, count, not};

let predicates: [fn(&i32) -> bool; 2] = [|value| *value > 0, |value| *value % 2 == 0];

assert!(all(&4, &predicates));
assert!(any(&3, &predicates));
assert_eq!(count(&4, &predicates), 2);
assert!(not(&3, |value| *value < 0));

When to use directly

Choose use-predicate when predicate composition is the only validation primitive you need.

Scope

  • Helpers stay value-first and function-pointer based.
  • Rules, constraints, and result types live in adjacent crates.

Status

use-predicate is a pre-1.0 crate with a deliberately small API.