picteach
picteach is a dependency-free Rust library for expressing the logic of
acceptance: what is allowed, how much deviation is tolerated, how rules combine,
and why a value was accepted or rejected.
use Policy;
let temperature = inclusive_range?;
let near_target = absolute_tolerance?;
let acceptable = any?;
let decision = acceptable.evaluate;
assert!;
assert_eq!;
# Ok::
Principles
- Acceptance is a named policy, not an unexplained boolean.
- Every evaluation produces a human-readable decision tree.
all,any, andnotpreserve child results for audits and user feedback.- Inclusive and exclusive ranges make boundary behavior explicit.
- Absolute tolerance includes its boundary and rejects non-finite observations.
- Relative tolerance supports an absolute floor for values near zero.
- Custom predicates can provide fixed or value-specific explanations.
- Policies are cloneable, thread-safe, and dependency-free.
Licensed under MIT.