Enum debris_hir::hir_nodes::HirExpression
source · pub enum HirExpression {
Show 14 variants
Variable(SpannedIdentifier),
Path(IdentifierPath),
PropertyAccess {
lhs: Box<HirExpression>,
rhs: SpannedIdentifier,
},
Value(HirConstValue),
UnaryOperation {
operation: HirPrefix,
value: Box<HirExpression>,
},
BinaryOperation {
operation: HirInfix,
lhs: Box<HirExpression>,
rhs: Box<HirExpression>,
},
Block(HirBlock),
Function(HirFunction),
FunctionCall(HirFunctionCall),
ConditionalBranch(HirConditionalBranch),
StructInitialization(HirStructInitialization),
TupleInitialization(HirTupleInitialization),
InfiniteLoop(HirInfiniteLoop),
ControlFlow(HirControlFlow),
}
Expand description
Any expression
Variants§
Variable(SpannedIdentifier)
A variable, for example a
Path(IdentifierPath)
A path, for example a.b.c
PropertyAccess
A generic property access, not necessarily in a path
Value(HirConstValue)
A literal value, for example 2.0
or "Hello World"
UnaryOperation
A unary operation, for example -a
BinaryOperation
A binary operation, for example a + b
Block(HirBlock)
A block which returns something
Function(HirFunction)
An anonymous function
FunctionCall(HirFunctionCall)
A function call, for example foo()
or path.to.foo()
ConditionalBranch(HirConditionalBranch)
StructInitialization(HirStructInitialization)
TupleInitialization(HirTupleInitialization)
InfiniteLoop(HirInfiniteLoop)
ControlFlow(HirControlFlow)
Implementations§
source§impl HirExpression
impl HirExpression
Trait Implementations§
source§impl Debug for HirExpression
impl Debug for HirExpression
source§impl PartialEq for HirExpression
impl PartialEq for HirExpression
source§fn eq(&self, other: &HirExpression) -> bool
fn eq(&self, other: &HirExpression) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HirExpression
impl StructuralEq for HirExpression
impl StructuralPartialEq for HirExpression
Auto Trait Implementations§
impl RefUnwindSafe for HirExpression
impl !Send for HirExpression
impl !Sync for HirExpression
impl Unpin for HirExpression
impl UnwindSafe for HirExpression
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.