pub struct Number {
pub unit: Option<ComplexUnit>,
pub data: NumberData,
}
Expand description
A scalar with a unit.
Fields§
§unit: Option<ComplexUnit>
§data: NumberData
Implementations§
Trait Implementations§
Source§impl CloneWithNode for Number
impl CloneWithNode for Number
Source§fn clone_with_node(&mut self) -> Self
fn clone_with_node(&mut self) -> Self
Clone
self
and take its node.Source§fn clone_without_node(&self) -> Self
fn clone_without_node(&self) -> Self
Clone
self
without taking its node.Source§impl ConvertFrom<AnyExpr> for Number
impl ConvertFrom<AnyExpr> for Number
Source§fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
fn convert_from(value: AnyExpr, context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§fn can_convert_from(value: &AnyExpr) -> bool
fn can_convert_from(value: &AnyExpr) -> bool
Check if conversion from a value to
Self
can be made.Source§impl ConvertFrom<Expr<Circle>> for Number
impl ConvertFrom<Expr<Circle>> for Number
Source§fn convert_from(value: Expr<Circle>, context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Circle>, context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl ConvertFrom<Expr<Derived>> for Number
impl ConvertFrom<Expr<Derived>> for Number
Source§fn convert_from(value: Expr<Derived>, context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Derived>, context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl ConvertFrom<Expr<Line>> for Number
impl ConvertFrom<Expr<Line>> for Number
Source§fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Line>, context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl ConvertFrom<Expr<Number>> for Number
impl ConvertFrom<Expr<Number>> for Number
Source§fn convert_from(value: Expr<Number>, _context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Number>, _context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl ConvertFrom<Expr<Point>> for Number
impl ConvertFrom<Expr<Point>> for Number
Source§fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Point>, context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl ConvertFrom<Expr<PointCollection>> for Number
impl ConvertFrom<Expr<PointCollection>> for Number
Source§fn convert_from(
value: Expr<PointCollection>,
context: &CompileContext,
) -> Expr<Self>
fn convert_from( value: Expr<PointCollection>, context: &CompileContext, ) -> Expr<Self>
Convert a value to
Self
. Read moreSource§fn can_convert_from(value: &Expr<PointCollection>) -> bool
fn can_convert_from(value: &Expr<PointCollection>) -> bool
Check if conversion from a value to
Self
can be made.Source§impl ConvertFrom<Expr<Unknown>> for Number
impl ConvertFrom<Expr<Unknown>> for Number
Source§fn convert_from(value: Expr<Unknown>, _context: &CompileContext) -> Expr<Self>
fn convert_from(value: Expr<Unknown>, _context: &CompileContext) -> Expr<Self>
Convert a value to
Self
. Read moreSource§impl Displayed for Number
impl Displayed for Number
Source§type Node = NumberNode
type Node = NumberNode
The display node type to use for displaying
Self
Source§impl FromExpr<Number> for NumberNode
impl FromExpr<Number> for NumberNode
Source§fn from_expr(
expr: &Expr<Number>,
props: Properties,
context: &CompileContext,
) -> Self
fn from_expr( expr: &Expr<Number>, props: Properties, context: &CompileContext, ) -> Self
Build a node out of an unrolled expression.
Source§impl FromUnrolled<Number> for ExprKind
impl FromUnrolled<Number> for ExprKind
Source§impl GetMathType for Number
impl GetMathType for Number
fn get_math_type() -> ExprType
Source§impl GetValueType for Number
impl GetValueType for Number
fn get_value_type(&self) -> Type
Auto Trait Implementations§
impl Freeze for Number
impl !RefUnwindSafe for Number
impl !Send for Number
impl !Sync for Number
impl Unpin for Number
impl !UnwindSafe for Number
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