pub struct ConversionTable<Q: Quantity, const N: usize> {
pub mappings: [(Q::UnitType, Q::UnitType, AmountT, AmountT); N],
}Expand description
A table defining the conversion between instances of quantity Q having
different units.
Each entry of the table is holding the following elements:
- from_unit: Q::UnitType,
- to_unit: Q::UnitType,
- factor: AmountT,
- offset: AmountT
defining the conversion to_amount = from_amount * factor + offset
Fields§
§mappings: [(Q::UnitType, Q::UnitType, AmountT, AmountT); N]Table of tuples (from_unit, to_unit, factor, offset), defining the conversion to_amount = from_amount * factor + offset
Trait Implementations§
Auto Trait Implementations§
impl<Q, const N: usize> Freeze for ConversionTable<Q, N>
impl<Q, const N: usize> RefUnwindSafe for ConversionTable<Q, N>
impl<Q, const N: usize> Send for ConversionTable<Q, N>
impl<Q, const N: usize> Sync for ConversionTable<Q, N>
impl<Q, const N: usize> Unpin for ConversionTable<Q, N>
impl<Q, const N: usize> UnsafeUnpin for ConversionTable<Q, N>
impl<Q, const N: usize> UnwindSafe for ConversionTable<Q, N>
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