Skip to main content

Crate dpp_rules

Crate dpp_rules 

Source
Expand description

dpp-rules — pure EU ESPR cross-field regulatory rules.

Rules are grouped by product group module. Batteries, textiles, and electronics are the active product groups; all others have placeholder modules and will be populated in a later phase.

Inputs are primitive borrowing views so each caller adapts its own representation — typed structs in core, serde_json::Value fields in plugins — without this crate depending on either. That is why this crate is kept separate from dpp-domain: a regulatory rule has exactly one implementation, shared by core and the Wasm plugins alike.

The bundle feature (off by default) adds the ruleset-bundle format + verification seam (the bundle module — conditionally compiled, so not linked here) and pulls in std — see that module’s docs.

Re-exports§

pub use chemicals::cas::validate_cas_format;
pub use chemicals::surfactants::SURFACTANT_BANDS;
pub use chemicals::surfactants::SurfactantInput;
pub use chemicals::surfactants::surfactant_band_valid;
pub use chemicals::surfactants::validate_surfactants;
pub use chemicals::svhc::CandidateList;
pub use chemicals::svhc::ECHA_CANDIDATE_LIST;
pub use chemicals::svhc::ECHA_CANDIDATE_LIST_AS_OF;
pub use chemicals::svhc::ECHA_CANDIDATE_LIST_OFFICIAL_COUNT;
pub use chemicals::svhc::SVHC_THRESHOLD_PCT;
pub use chemicals::svhc::SvhcFinding;
pub use chemicals::svhc::SvhcFindingKind;
pub use chemicals::svhc::SvhcInput;
pub use chemicals::svhc::check_svhc_declarations;
pub use chemicals::svhc::check_svhc_declarations_embedded;
pub use chemicals::svhc::validate_svhc_substances;
pub use common::country::country_code_valid;
pub use textiles::fibre::FIBRE_SUM_TOLERANCE;
pub use textiles::fibre::FibreInput;
pub use textiles::fibre::fibre_sum_ok;
pub use textiles::fibre::validate_fibre_composition;

Modules§

batteries
Batteries — EU Regulation 2023/1542, Annex XIII (battery passport data attributes).
chemicals
Chemical substance rules — REACH, RoHS, EU 2026/405 and related regulations.
common
Cross-product group helper rules: country code validation, unique product identifier syntax, numeric utilities, unit conversions, and the dependency-free date key used for regulatory phase selection.
construction
Construction — regulatory basis pending (ESPR provisional product group).
electronics
Electronics — EU Ecodesign Regulation (ESPR), product group rules. NOTE: repairability scoring (EN 45554 A–E grades, weighted) lives in dpp-calc, not here.
lineage
Lineage rules — the cross-field checks that bind one passport to another.
lint
Passport plausibility lints — non-binding findings that flag implausible data (arithmetic that doesn’t add up, values outside physically plausible ranges, or fields whose declared values are inconsistent with each other), as distinct from the malformed data JSON Schema catches or the non-compliant data a crate::batteries/crate::textiles-style rule catches. A lint finding never blocks publish — see LintSeverity.
metals
Metals — CBAM (EU Regulation 2023/956) and EU ESPR product group rules.
textiles
Textiles — EU ESPR textile product group rules (unsold textiles, garment labelling).
toys
Toys — EN 71 / REACH / ESPR provisional product group.
unsold_goods
Unsold consumer products — the ESPR Art. 25 destruction ban (Annex VII) and the Art. 24 disclosure duty (Impl. Reg. (EU) 2026/2).