pub struct UnitDef {
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,
}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).
Trait Implementations§
impl Copy for UnitDef
impl Eq for UnitDef
impl StructuralPartialEq for UnitDef
Auto Trait Implementations§
impl Forget for UnitDef
impl Freeze for UnitDef
impl RefUnwindSafe for UnitDef
impl Send for UnitDef
impl Sync for UnitDef
impl Unpin for UnitDef
impl UnsafeUnpin for UnitDef
impl UnwindSafe for UnitDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more