Enum beancount_parser::amount::Expression
source · #[non_exhaustive]
pub enum Expression {
Value(Value),
Operation(Operation),
}Expand description
An expression
Examples of expressions:
422 + 25 / (6 + (8 / 2))
The expression can be evaluated with Expression::evaluate
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Value(Value)
A direct value, the leaf of the expression tree
Operation(Operation)
An operation, made of two expression operands
Implementations§
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy 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 Expression
impl Debug for Expression
source§impl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for
self and other values to be equal, and is used
by ==.