pub struct Atom {
pub element: Element,
pub isotope: Option<u16>,
pub charge: i8,
pub hydrogen_count: Option<u8>,
pub aromatic: bool,
pub chirality: Chirality,
pub wildcard: bool,
pub atom_map: Option<u16>,
pub cip_code: Option<CipCode>,
}Expand description
A single atom in a molecular graph.
isotope: mass number (e.g. 13 for ¹³C).None= natural isotope abundance.charge: formal charge.hydrogen_count: explicit H count from a bracket atom[...].Nonefor organic-subset atoms whose H count is inferred from valence.aromatic: set when the atom is written as a lowercase letter (c, n, …) or connected via:bonds.wildcard:truefor the SMILES*atom (any element, query context).atom_map: atom-mapping number used in reaction SMILES.cip_code: CIP stereodescriptor (R/S/E/Z). Populated bychematic_chem::assign_cip;Noneuntil then.
Fields§
§element: Element§isotope: Option<u16>§charge: i8§hydrogen_count: Option<u8>Explicit H count (bracket atoms only). None for organic-subset atoms.
aromatic: bool§chirality: Chirality§wildcard: boolTrue for the wildcard atom * or [*].
atom_map: Option<u16>§cip_code: Option<CipCode>CIP stereodescriptor assigned by chematic_chem::assign_cip.
None until explicitly computed.
Implementations§
Source§impl Atom
impl Atom
Sourcepub fn organic(element: Element) -> Self
pub fn organic(element: Element) -> Self
Organic-subset atom (charge=0, non-aromatic, implicit H from valence).
Sourcepub fn bracket(
element: Element,
isotope: Option<u16>,
chirality: Chirality,
hydrogen_count: u8,
charge: i8,
atom_map: Option<u16>,
) -> Self
pub fn bracket( element: Element, isotope: Option<u16>, chirality: Chirality, hydrogen_count: u8, charge: i8, atom_map: Option<u16>, ) -> Self
Bracket atom with explicit properties.
Sourcepub fn explicit_hcount(&self) -> Option<u8>
pub fn explicit_hcount(&self) -> Option<u8>
Return the explicit H count for bracket atoms; None for organic-subset atoms.
Trait Implementations§
impl Eq for Atom
impl StructuralPartialEq for Atom
Auto Trait Implementations§
impl Freeze for Atom
impl RefUnwindSafe for Atom
impl Send for Atom
impl Sync for Atom
impl Unpin for Atom
impl UnsafeUnpin for Atom
impl UnwindSafe for Atom
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more