pub struct BaseUnit {
pub name: &'static str,
pub symbol: &'static str,
pub aliases: &'static [&'static str],
pub dimension: Dimension,
pub scale: f64,
pub offset: f64,
}Expand description
An irreducible base unit like meter, second, or kilogram.
Fields§
§name: &'static strPrimary name (e.g., “meter”)
symbol: &'static strShort symbol (e.g., “m”)
aliases: &'static [&'static str]Alternative names/aliases
dimension: DimensionThe dimension this unit represents
scale: f64Scale relative to the canonical SI base unit (1.0 for SI base units)
offset: f64Additive offset for converting to SI: SI = (value + offset) * scale.
Zero for most units. Celsius has offset 273.15 (K = °C + 273.15).
Implementations§
Trait Implementations§
impl Copy for BaseUnit
impl StructuralPartialEq for BaseUnit
Auto Trait Implementations§
impl Freeze for BaseUnit
impl RefUnwindSafe for BaseUnit
impl Send for BaseUnit
impl Sync for BaseUnit
impl Unpin for BaseUnit
impl UnsafeUnpin for BaseUnit
impl UnwindSafe for BaseUnit
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