Crate utomid_rs

Crate utomid_rs 

Source
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§

CompactCompound
A more compact compound representation: [(element_id, count)] Example: H2O -> [(1, 2), (8, 1)]
Element

Statics§

ELEMENTS

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