Enum chem_parse::ast_types::Node
source · [−]pub enum Node {
Element(u16, String),
Group(u16, Vec<Node>),
ForumulaUnit(u16, Vec<Node>),
Reactants(Vec<Node>),
Products(Vec<Node>),
Equation(Box<Node>, Box<Node>),
}Expand description
A Node in the AST (abstract syntax tree)
Variants
Element(u16, String)
Chemical elements e.g. O2. The number is the subscript, in this case 2
Group(u16, Vec<Node>)
Groups of elements or other groups (Polyatoms) e.g. (2FeO2)4 The number is the subscript, in this case 4
ForumulaUnit(u16, Vec<Node>)
Forumula Unit, a few elements and/or polyatoms eg 7(NH4)2SO4 This number is the coeffecient, in this case 7
Reactants(Vec<Node>)
The reactants side (left) of yields (->)
Products(Vec<Node>)
The products side (right) of yeilds (->)
Equation(Box<Node>, Box<Node>)
The whole equation
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more