pub struct UnitSimple<S: MS> {
pub ratio: S::N,
pub offset: S::N,
}
Expand description
A Simple Unit in a given MeasureSystem
The equations for Unit are as follows:
self.to_base = (val + self.offset) * self.ratio
self.to_self = (val / self.ratio) - self.offset
If greater flexibility is required, please see `UnitTrait
Fields§
§ratio: S::N
§offset: S::N
Trait Implementations§
Source§impl<S: MS> Debug for UnitSimple<S>
impl<S: MS> Debug for UnitSimple<S>
Source§impl<S: MS> UnitTrait for UnitSimple<S>
impl<S: MS> UnitTrait for UnitSimple<S>
impl<S: MS> StructuralPartialEq for UnitSimple<S>
Auto Trait Implementations§
impl<S> Freeze for UnitSimple<S>
impl<S> RefUnwindSafe for UnitSimple<S>
impl<S> Send for UnitSimple<S>
impl<S> Sync for UnitSimple<S>
impl<S> Unpin for UnitSimple<S>
impl<S> UnwindSafe for UnitSimple<S>
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