pub struct UnitDef {Show 13 fields
pub symbol: &'static str,
pub aliases: &'static [&'static str],
pub dim: [i8; 7],
pub kind: Kind,
pub shape: Shape,
pub factor: (i128, i128),
pub offset: (i128, i128),
pub exactness: Exactness,
pub prefixes: PrefixMode,
pub namespace: &'static str,
pub source: &'static str,
pub note: &'static str,
pub conditions: &'static str,
}Expand description
A unit as it appears in a compiled data table (plain data, const-constructible).
Fractions are (numerator, denominator) pairs; the registry validates and reduces them
when loading.
Fields§
§symbol: &'static strPrimary symbol, for example psi.
aliases: &'static [&'static str]Alternative symbols, for example ["\u{b0}C"] for degC.
dim: [i8; 7]Dimension exponents of [kg, m, s, A, K, mol, cd].
kind: KindQuantity kind.
shape: ShapeConversion shape to the coherent SI unit.
factor: (i128, i128)Factor a in si = a * x + b, as (numerator, denominator).
offset: (i128, i128)Offset b in si = a * x + b, as (numerator, denominator).
exactness: ExactnessDefined or measured.
prefixes: PrefixModeAccepted prefixes.
namespace: &'static strNamespace, si or std for the core table.
source: &'static strCitation of the primary definition.
note: &'static strFree-text note (derivation, caveats).
conditions: &'static strThe reference state the unit is defined at (ADR-013), for example
273.15 K, 101 325 Pa. Empty for a unit without one; required for a reference kind.