pub struct Atom { /* private fields */ }Expand description
A chemical atom with element, formal charge, and isotope.
Implementations§
Source§impl Atom
impl Atom
pub fn new( element: AtomSymbol, charge: i8, isotope: Option<u16>, ) -> Result<Atom, AtomError>
Sourcepub fn implicit_hydrogens(
&self,
bond_order_sum: Option<u8>,
aromatic: bool,
) -> Result<u8, AtomError>
pub fn implicit_hydrogens( &self, bond_order_sum: Option<u8>, aromatic: bool, ) -> Result<u8, AtomError>
Calculates implicit hydrogens for organic-subset atoms.
Returns Ok(0) for bracket atoms (non-organic), where hydrogen count
is always explicit. Returns an error if bond_order_sum is missing
for an organic atom.
Sourcepub fn is_organic(&self) -> bool
pub fn is_organic(&self) -> bool
Returns true if this atom is from the organic subset (B, C, N, O, P, S, F, Cl, Br, I).
Sourcepub fn element(&self) -> &AtomSymbol
pub fn element(&self) -> &AtomSymbol
Returns the element symbol.
Trait Implementations§
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