pub enum MacroDecimal {
Value(f64),
Variable(u32),
Expression(String),
}
Expand description
A macro decimal can either be an f64 or a variable placeholder.
Variants§
Value(f64)
A decimal value.
Variable(u32)
A variable placeholder.
Expression(String)
An expression placeholder, e.g. “$3+($4/2)” or “$1x4”.
Gerber spec (4.5.4.2 Arithmetic Expressions) says: “The standard arithmetic precedence rules apply”. i.e. not Rust/C precedence rules. Allowed elements: “integer and decimal constants, other variables, arithmetic operators and the brackets ‘(’ and ‘)’” Allowed operators: ‘+’, ‘-’, ‘x’ (lower case), ‘/’.
Trait Implementations§
Source§impl Clone for MacroDecimal
impl Clone for MacroDecimal
Source§fn clone(&self) -> MacroDecimal
fn clone(&self) -> MacroDecimal
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MacroDecimal
impl Debug for MacroDecimal
Source§impl From<MacroDecimal> for MacroBoolean
impl From<MacroDecimal> for MacroBoolean
Source§fn from(value: MacroDecimal) -> Self
fn from(value: MacroDecimal) -> Self
Converts to this type from the input type.
Source§impl From<f32> for MacroDecimal
impl From<f32> for MacroDecimal
Source§impl From<f64> for MacroDecimal
impl From<f64> for MacroDecimal
Source§impl PartialEq for MacroDecimal
impl PartialEq for MacroDecimal
impl StructuralPartialEq for MacroDecimal
Auto Trait Implementations§
impl Freeze for MacroDecimal
impl RefUnwindSafe for MacroDecimal
impl Send for MacroDecimal
impl Sync for MacroDecimal
impl Unpin for MacroDecimal
impl UnwindSafe for MacroDecimal
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