Enum arithmetic_parser::ExprType
source · #[non_exhaustive]pub enum ExprType {
Variable,
Literal,
FnDefinition,
Cast,
Function,
FieldAccess,
Method,
Unary,
Binary,
Tuple,
Object,
Block,
}
Expand description
Type of an Expr
.
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.
Variable
Variable use, e.g., x
.
Literal
Literal (semantic depends on the grammar).
FnDefinition
Function definition, e.g., |x, y| { x + y }
.
Cast
Cast, e.g., x as Bool
.
Function
Function call, e.g., foo(x, y)
or |x| { x + 5 }(3)
.
FieldAccess
Field access, e.g., foo.bar
.
Method
Method call, e.g., foo.bar(x, 5)
.
Unary
Unary operation, e.g., -x
.
Binary
Binary operation, e.g., x + 1
.
Tuple
Tuple expression, e.g., (x, y + z)
.
Object
Object expression, e.g., #{ x = 1; y = x + 2; }
.
Block
Block expression, e.g., { x = 3; x + y }
.
Trait Implementations§
source§impl From<ExprType> for UnsupportedType
impl From<ExprType> for UnsupportedType
source§impl PartialEq for ExprType
impl PartialEq for ExprType
impl Copy for ExprType
impl Eq for ExprType
impl StructuralPartialEq for ExprType
Auto Trait Implementations§
impl Freeze for ExprType
impl RefUnwindSafe for ExprType
impl Send for ExprType
impl Sync for ExprType
impl Unpin for ExprType
impl UnwindSafe for ExprType
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)