Enum mathemascii::SimpleExpr
source · pub enum SimpleExpr {
Var(Var),
Grouping(GroupingExpr),
Unary(Unary),
Binary(Binary),
Interm(Box<Expression>),
}
Expand description
Simple AsciiMath expression that can be one of the following:
- Variable - any number, identifier, greek letter etc.
- Grouping - any number of expressions surrounded by parentheses, brackets, braces etc.
- Unary - unary operator applied to an expression, i.e.
sqrt(a)
. - Binary - binary operator applied to two expressions, i.e.
root(3)(a + b)
.
Variants§
Var(Var)
Variable - any number, identifier, greek letter etc.
Grouping(GroupingExpr)
Grouping - any number of expressions surrounded by parentheses, brackets, braces etc.
Unary(Unary)
Unary operator applied to an expression, i.e. sqrt(a)
.
Binary(Binary)
Binary operator applied to two expressions, i.e. root(3)(a + b)
.
Interm(Box<Expression>)
Intermediate expression is simply a wrapped Expression
.
AsciiMath differs Expression and Intermediate expression, but in this implementation they
are the same. The top-level expression defined in ascii math grammar is the AsciiMath
iterator that produces multiple Expression
s.
Implementations§
Trait Implementations§
source§impl Clone for SimpleExpr
impl Clone for SimpleExpr
source§fn clone(&self) -> SimpleExpr
fn clone(&self) -> SimpleExpr
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 SimpleExpr
impl Debug for SimpleExpr
source§impl IntoElements for SimpleExpr
impl IntoElements for SimpleExpr
source§fn into_elements(self) -> Elements
fn into_elements(self) -> Elements
Converts the type into elements.
source§impl PartialEq for SimpleExpr
impl PartialEq for SimpleExpr
source§fn eq(&self, other: &SimpleExpr) -> bool
fn eq(&self, other: &SimpleExpr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SimpleExpr
impl StructuralEq for SimpleExpr
impl StructuralPartialEq for SimpleExpr
Auto Trait Implementations§
impl RefUnwindSafe for SimpleExpr
impl Send for SimpleExpr
impl Sync for SimpleExpr
impl Unpin for SimpleExpr
impl UnwindSafe for SimpleExpr
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