pub struct UnitDecl<P: Phase = Raw> {
pub visibility: Visibility,
pub constness: UnitConstness,
pub name: Spanned<UnitName>,
pub dim_type: DimExpr,
pub definition: Option<UnitDef<P>>,
}Expand description
Unit declaration: const unit km: Length = 1000 m;, unit EUR: Money = (@rate) USD;,
or base unit m: Length;.
Fields§
§visibility: Visibility§constness: UnitConstness§name: Spanned<UnitName>§dim_type: DimExprThe dimension this unit measures.
definition: Option<UnitDef<P>>Scale definition: (scale_value, base_unit_expr).
None iff this is a base unit (base unit m: Length;).
Trait Implementations§
Source§impl FormatEquivalent for UnitDecl
impl FormatEquivalent for UnitDecl
Source§fn format_equivalent(&self, other: &Self) -> bool
fn format_equivalent(&self, other: &Self) -> bool
Returns
true if self and other are equivalent up to formatting.Auto Trait Implementations§
impl<P> Freeze for UnitDecl<P>
impl<P> RefUnwindSafe for UnitDecl<P>
impl<P> Send for UnitDecl<P>
impl<P> Sync for UnitDecl<P>
impl<P> Unpin for UnitDecl<P>
impl<P> UnsafeUnpin for UnitDecl<P>
impl<P> UnwindSafe for UnitDecl<P>
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