Expand description
§Utomid
Utomid is a compact encoding for chemical elements and compounds.
use utomid_rs::{CompactCompound, compound_formula};
let water = CompactCompound::new(vec![(1,2), (8,1)]); // H2O
assert_eq!(water.formula(), "H2O");Structs§
- Compact
Compound - A more compact compound representation: [(element_id, count)] Example: H2O -> [(1, 2), (8, 1)]
- Element
Statics§
Functions§
- compound_
formula - Convert a flat list of element IDs into a chemical formula string Example: [1, 1, 8] -> “H2O”
- compound_
mass - Compute the total mass of a compound represented as a flat list of element IDs Example: [1, 1, 8] = H2O
- decode_
utomid - encode_
utomid - get_
element