pub struct Unit {
pub symbol: &'static str,
pub dimension: Dimension,
pub scale: Rational,
pub offset: Rational,
}Expand description
A unit of measurement: its dimension and how to map a value in this unit to the SI base.
si = value · scale + offset. Linear units have offset = 0; affine units (°C, °F) do not.
Fields§
§symbol: &'static str§dimension: Dimension§scale: RationalMultiply a value in this unit by scale to reach the SI base unit. Exact, nonzero.
offset: RationalThe affine zero offset, added after scaling (0 for linear units).
Implementations§
Trait Implementations§
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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