dpp_rules/lib.rs
1//! `dpp-rules` — pure EU ESPR cross-field regulatory rules.
2//!
3//! Rules are grouped by sector module. Batteries, textiles, and electronics are
4//! the active sectors; all others have placeholder modules and will be populated
5//! in a later phase.
6//!
7//! Inputs are primitive borrowing views so each caller adapts its own
8//! representation — typed structs in core, `serde_json::Value` fields in
9//! plugins — without this crate depending on either.
10//!
11//! See `docs/architecture/SECTOR-MODEL-CONSOLIDATION.md` §7.
12
13#![no_std]
14#![forbid(unsafe_code)]
15
16extern crate alloc;
17
18#[cfg(test)]
19extern crate std;
20
21// Shared helpers (cross-sector utilities).
22pub mod common;
23
24// Chemical substance rules — REACH, RoHS, EU 2026/405.
25// SVHC lives here rather than under any single sector because REACH Art. 33
26// applies across textiles, electronics, toys, construction, and more.
27pub mod chemicals;
28
29// Active sectors.
30pub mod batteries;
31pub mod electronics;
32pub mod textiles;
33
34// Placeholder sectors — rules to be implemented in a later phase.
35pub mod construction;
36pub mod metals;
37pub mod toys;
38
39// ── Crate-root re-exports ────────────────────────────────────────────────────
40// Preserved for backward compatibility with existing callers
41// (dpp-domain adapters, dpp-plugin-sdk::rules).
42
43pub use chemicals::cas::validate_cas_format;
44pub use chemicals::surfactants::{
45 SURFACTANT_BANDS, SurfactantInput, surfactant_band_valid, validate_surfactants,
46};
47pub use chemicals::svhc::{
48 ECHA_CANDIDATE_LIST, SVHC_THRESHOLD_PCT, SvhcFinding, SvhcFindingKind, SvhcInput,
49 check_svhc_declarations, validate_svhc_substances,
50};
51pub use common::country::country_code_valid;
52pub use textiles::fibre::{
53 FIBRE_SUM_TOLERANCE, FibreInput, fibre_sum_ok, validate_fibre_composition,
54};