pub enum Expression {
Show 14 variants
LiteralInteger(i64),
LiteralReal(String),
LiteralString(String),
LiteralBoolean(bool),
FeatureRef(String),
MemberAccess(Box<Node<Expression>>, String),
Index {
base: Box<Node<Expression>>,
index: Box<Node<Expression>>,
},
Bracket(Box<Node<Expression>>),
LiteralWithUnit {
value: Box<Node<Expression>>,
unit: Box<Node<Expression>>,
},
BinaryOp {
op: BinaryOperator,
left: Box<Node<Expression>>,
right: Box<Node<Expression>>,
},
UnaryOp {
op: UnaryOperator,
operand: Box<Node<Expression>>,
},
Invocation {
callee: Box<Node<Expression>>,
args: Vec<Node<Expression>>,
},
Tuple(Vec<Node<Expression>>),
Null,
}Expand description
Expression: literals, feature refs, member access, index, bracket/unit, etc.
Variants§
LiteralInteger(i64)
LiteralReal(String)
LiteralString(String)
LiteralBoolean(bool)
FeatureRef(String)
Single name or qualified name.
MemberAccess(Box<Node<Expression>>, String)
base.member (e.g. engine.fuelCmdPort).
Index
base#(index) e.g. frontWheel#(1).
Bracket(Box<Node<Expression>>)
unit e.g. [kg].
LiteralWithUnit
value unit e.g. 1750 [kg].
BinaryOp
Binary infix operation e.g. a >= b * c, x / y.
UnaryOp
Unary prefix: + - ~ not
Invocation
Function-like invocation, e.g. ComputeMargin(a, b).
Tuple(Vec<Node<Expression>>)
Comma-separated sequence in parentheses, e.g. (engine1, engine2) for ordered composition values.
Null
KerML null or empty sequence ().
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Expression
impl Debug for Expression
impl Eq for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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