pub enum UnitScale {
Static(PositiveFiniteScale),
Dynamic {
scale_expr: Expr,
base_unit_scale: PositiveFiniteScale,
},
}Expand description
How a unit’s scale factor is determined.
Variants§
Static(PositiveFiniteScale)
Scale factor known at compile time (e.g., const unit km: Length = 1000 m;).
Dynamic
Scale factor depends on runtime values (e.g., unit EUR: Money = (@rate) USD;).
The final SI scale = eval(scale_expr) * base_unit_scale.
Fields
§
base_unit_scale: PositiveFiniteScaleThe scale factor of the base unit in the definition (resolved at compile time).
For (@rate) USD where USD has scale 1.0, this is 1.0.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UnitScale
impl RefUnwindSafe for UnitScale
impl Send for UnitScale
impl Sync for UnitScale
impl Unpin for UnitScale
impl UnsafeUnpin for UnitScale
impl UnwindSafe for UnitScale
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