pub struct SubstanceIdentifier {
pub cas: Option<String>,
pub smiles: Option<String>,
pub iupac_name: Option<String>,
pub inchi: Option<String>,
pub inchi_key: Option<String>,
pub cid: Option<u64>,
}Expand description
Set of identifiers for a single chemical compound.
Provide at least one field. When multiple fields are set, the pipeline uses them in priority order: CAS → SMILES → InChIKey → InChI → IUPAC name.
Important: iupac_name must be an IUPAC systematic name.
Trade names and common aliases (e.g. “caustic soda”) are not accepted
because they cannot be reliably resolved in PubChem.
Fields§
§cas: Option<String>CAS registry number (e.g. "1310-73-2").
smiles: Option<String>Canonical SMILES string (e.g. "[Na+].[OH-]").
iupac_name: Option<String>IUPAC systematic name (e.g. "sodium hydroxide").
Do not use trade names or common aliases.
inchi: Option<String>InChI string (e.g. "InChI=1S/Na.H2O/h;1H/q+1;/p-1").
inchi_key: Option<String>27-character InChIKey (e.g. "HEMHJVSKTPXQMS-UHFFFAOYSA-M").
cid: Option<u64>PubChem Compound ID — set automatically after a PubChem lookup.
Implementations§
Source§impl SubstanceIdentifier
impl SubstanceIdentifier
pub fn from_cas(cas: impl Into<String>) -> Self
pub fn from_smiles(smiles: impl Into<String>) -> Self
pub fn from_iupac_name(name: impl Into<String>) -> Self
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Short display string for logging and error messages.
Trait Implementations§
Source§impl Clone for SubstanceIdentifier
impl Clone for SubstanceIdentifier
Source§fn clone(&self) -> SubstanceIdentifier
fn clone(&self) -> SubstanceIdentifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more