MolFile::parse reads a V2000 molfile (.mol), or the first record of an .sdf file: the
title, the atoms with their positions and charges (M CHG lines replace the charges of
the atom block) and the bonds. V3000 files return MolError::V3000; save them as V2000.
structure()gives the skeletal formula forMolecule2D. Hydrogens bonded to another atom are counted on it instead of drawn, and aromatic bonds become alternating single and double bonds. A 2D file keeps its positions, scaled so bonded atoms are one bond length apart, with its wedges and hashes. A file without positions, or with 3D ones, is laid out bychematiclike a SMILES string.structure_3d()(with the3dfeature) gives every atom, hydrogens too, at its position in the file forMolecule3D. It returnsNonewhen the file has no positions.
Gallery scene: MolFile (paracetamol from a 2D file, ethanol from a 3D SDF record).

MolFile 3 suse fframes_kit::prelude::*;
fn read(text: &str) -> Result<Structure, MolError> { Ok(MolFile::parse(text)?.structure())}
fn figure<'a>(ui: &mut Ui<'a, '_, '_>, structure: &'a Structure) -> Svgr<'a> { ui.show(Molecule2D { structure: Some(structure), bond_length: 90.0, enter: Some(Create::default().into()), ..ui.defaults() })}