Enum NumberData

Source
pub enum NumberData {
Show 29 variants Generic(Generic<Number>), Number(ProcNum), DstLiteral(ProcNum), SetUnit(Expr<Number>, ComplexUnit), PointPointDistance(Expr<Point>, Expr<Point>), PointLineDistance(Expr<Point>, Expr<Line>), Negate(Expr<Number>), Add(Expr<Number>, Expr<Number>), Subtract(Expr<Number>, Expr<Number>), Multiply(Expr<Number>, Expr<Number>), Divide(Expr<Number>, Expr<Number>), ThreePointAngle(Expr<Point>, Expr<Point>, Expr<Point>), ThreePointAngleDir(Expr<Point>, Expr<Point>, Expr<Point>), TwoLineAngle(Expr<Line>, Expr<Line>), Average(ClonedVec<Expr<Number>>), CircleRadius(Expr<Circle>), Pow(Expr<Number>, CompExponent), PointX(Expr<Point>), PointY(Expr<Point>), Free, FromPoint(Expr<Point>), Real(Expr<Number>), Imaginary(Expr<Number>), Log(Expr<Number>), Exp(Expr<Number>), Sin(Expr<Number>), Cos(Expr<Number>), Atan2(Expr<Number>, Expr<Number>), Direction(Expr<Line>),
}
Expand description

An unrolled number expression

Variants§

§

Generic(Generic<Number>)

A generic expression

§

Number(ProcNum)

A constant

§

DstLiteral(ProcNum)

A distance literal not meant to be multiplied by the distance unit.

§

SetUnit(Expr<Number>, ComplexUnit)

Override the expression’s unit.

§

PointPointDistance(Expr<Point>, Expr<Point>)

Distance between two points.

§

PointLineDistance(Expr<Point>, Expr<Line>)

Distance of a point from a line.

§

Negate(Expr<Number>)

Minus expression

§

Add(Expr<Number>, Expr<Number>)

a + b

§

Subtract(Expr<Number>, Expr<Number>)

a - b

§

Multiply(Expr<Number>, Expr<Number>)

a * b

§

Divide(Expr<Number>, Expr<Number>)

a / b

§

ThreePointAngle(Expr<Point>, Expr<Point>, Expr<Point>)

Angle defined by three points.

§

ThreePointAngleDir(Expr<Point>, Expr<Point>, Expr<Point>)

Directed angle defined by three points.

§

TwoLineAngle(Expr<Line>, Expr<Line>)

Angle between two lines.

§

Average(ClonedVec<Expr<Number>>)

The arithmetic mean of numbers.

§

CircleRadius(Expr<Circle>)

Radius of a circle

§

Pow(Expr<Number>, CompExponent)

Raise a number to a power

§

PointX(Expr<Point>)

X coordinate of a point

§

PointY(Expr<Point>)

Y coordinate of a point

§

Free

A free number.

§

FromPoint(Expr<Point>)

A point as a complex number

§

Real(Expr<Number>)

Real part of a number

§

Imaginary(Expr<Number>)

Imaginary part of a number

§

Log(Expr<Number>)

Natural logarithm (base e)

§

Exp(Expr<Number>)

Exp function (e^this)

§

Sin(Expr<Number>)

Sine

§

Cos(Expr<Number>)

Cosine

§

Atan2(Expr<Number>, Expr<Number>)

Atan2

§

Direction(Expr<Line>)

A line’s direction vector

Trait Implementations§

Source§

impl CloneWithNode for NumberData

Source§

fn clone_with_node(&mut self) -> Self

Clone self and take its node.
Source§

fn clone_without_node(&self) -> Self

Clone self without taking its node.
Source§

impl Debug for NumberData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for NumberData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Convert for T

Source§

fn convert<U>(self, context: &CompileContext) -> Expr<U>
where U: ConvertFrom<T>,

Convert self into a specific type. Read more
Source§

fn can_convert<U>(&self) -> bool
where U: ConvertFrom<T>,

Check if self can be converted into a specific type. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.