Skip to main content

par_validator/
lib.rs

1//! Parallel validation helpers for **string-like** fields (CPU / Rayon) and **fixed-point
2//! numerics** (GPU / wgpu).
3//!
4//! ## String rules
5//! Use [`Rule`](crate::builder::Rule) from [`builder`] with **`bool` predicates** and a paired
6//! error value `E` per rule (see [`builder::Rule::mandatory_rule`] / [`builder::Rule::rule`]).
7//! Mandatory rules run **sequentially** and short-circuit; remaining rules run in parallel with
8//! Rayon inside [`Rule::apply`](crate::builder::Rule::apply).
9//!
10//! ## Numeric rules
11//! See [`gpu_numeric`] for [`GpuNumericEngine`](gpu_numeric::GpuNumericEngine), which batches
12//! [`NumericRule`](gpu_numeric::NumericRule) rows in a single compute dispatch. Values cross the
13//! CPU/GPU boundary as **i32 × 100** (no `f32`/`f64` in the shader).
14//!
15//! ## Examples
16//! - `cargo run --example basics` — CPU-only starter  
17//! - `cargo run --example hybrid_gpu` — small hybrid demo  
18//! - `cargo run --example fintech_rayon_nested` — large nested batch, CPU only  
19//! - `cargo run --example fintech_gpu_batch` — large numeric batch, GPU only  
20//! - `cargo run --example fintech_hybrid_batch` — both layers on a trade batch  
21//! - `cargo run --example rule_csv_catalog` — [`builder::Rule`] + CSV catalog  
22
23#![forbid(unsafe_code)]
24
25pub mod builder;
26pub mod errors;
27pub mod gpu_numeric;
28
29pub use builder::Rule;
30pub use errors::RuleBuilderError;