pub enum Node {
    Element(u16String),
    Group(u16Vec<Node>),
    ForumulaUnit(u16Vec<Node>),
    Reactants(Vec<Node>),
    Products(Vec<Node>),
    Equation(Box<Node>, Box<Node>),
}
Expand description

A Node in the AST (abstract syntax tree)

Variants

Element(u16String)

Chemical elements e.g. O2. The number is the subscript, in this case 2

Group(u16Vec<Node>)

Groups of elements or other groups (Polyatoms) e.g. (2FeO2)4 The number is the subscript, in this case 4

ForumulaUnit(u16Vec<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

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.