Skip to main content

Crate dimvexa_data

Crate dimvexa_data 

Source
Expand description

The unit table of dimvexa, compiled from audited TOML at build time.

The source of truth is data/units/*.toml and data/constants/*.toml (inside this crate): each unit carries an exact rational factor, an exactness flag (defined or measured), a cited source and a note, and has at least one golden test vector in data/vectors/. cargo xtask validate-data enforces this.

let reg = dimvexa_data::registry()?;
let c = reg.conversion("psi", "Pa")?;
assert!((c.apply(1.0) - 6894.757_293_168_361).abs() < 1e-9);

Constants§

DATA_HASH
Hash of the unit tables (FNV-1a 64, detects accidental changes, not cryptographic).
DATA_VERSION
Table format and content version, bumped whenever the hash changes.
PACKS
Names of the packs compiled in.

Statics§

AMBIGUOUS
Bare symbols that are rejected as ambiguous.
CONSTANTS
All built-in constants (ADR-018).
UNITS
All units of the seed table.

Functions§

constant
The built-in constant with the identifier id, if there is one (ADR-018).
data_version
A printable identifier of the table: v<version>+<hash>.
registry
Builds a Registry from the compiled seed table.