pub struct NumberUnit<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64>(pub Expr<Number>);
Expand description
Number with a specific unit.
Tuple Fields§
§0: Expr<Number>
Implementations§
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
pub fn get_unit() -> ComplexUnit
Methods from Deref<Target = Expr<Number>>§
Sourcepub fn can_convert_unit(&self, unit: Option<ComplexUnit>) -> bool
pub fn can_convert_unit(&self, unit: Option<ComplexUnit>) -> bool
Checks whether a unit conversion can be performed
Sourcepub fn take_node(&mut self) -> Option<HierarchyNode<T::Node>>
pub fn take_node(&mut self) -> Option<HierarchyNode<T::Node>>
Take the expression’s display node.
Trait Implementations§
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Debug for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Debug for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Deref for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Deref for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> DerefMut for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> DerefMut for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Display for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Display for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Dummy for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Dummy for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Source§impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> From<Expr<Number>> for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> From<Expr<Number>> for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
Auto Trait Implementations§
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Freeze for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> !RefUnwindSafe for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> !Send for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> !Sync for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> Unpin for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
impl<const DST_NUM: i64, const DST_DENOM: i64, const ANG_NUM: i64, const ANG_DENOM: i64> !UnwindSafe for NumberUnit<DST_NUM, DST_DENOM, ANG_NUM, ANG_DENOM>
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
Source§impl<T> Convert for T
impl<T> Convert for T
Source§fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
fn convert<U>(self, context: &CompileContext) -> Expr<U>where
U: ConvertFrom<T>,
Convert
self
into a specific type. Read moreSource§fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
fn can_convert<U>(&self) -> boolwhere
U: ConvertFrom<T>,
Check if
self
can be converted into a specific type. Read more