pub struct MolecularAtom { /* private fields */ }Expand description
An explicit atom entry in a molecule.
Implementations§
Source§impl MolecularAtom
impl MolecularAtom
Sourcepub fn new(label: &str) -> Result<Self, MoleculeValidationError>
pub fn new(label: &str) -> Result<Self, MoleculeValidationError>
Creates a molecular atom from an atom label.
§Errors
Returns MoleculeValidationError when label is empty or does not match the supported
element-symbol shape.
Sourcepub const fn id(&self) -> Option<&MolecularAtomId>
pub const fn id(&self) -> Option<&MolecularAtomId>
Returns the optional atom identifier.
Sourcepub fn with_id(self, id: MolecularAtomId) -> Self
pub fn with_id(self, id: MolecularAtomId) -> Self
Sets the atom identifier from a validated value.
Sourcepub fn try_with_id(self, id: &str) -> Result<Self, MoleculeValidationError>
pub fn try_with_id(self, id: &str) -> Result<Self, MoleculeValidationError>
Sets the atom identifier after validation.
§Errors
Returns MoleculeValidationError::EmptyAtomId when id is empty after trimming.
Trait Implementations§
Source§impl Clone for MolecularAtom
impl Clone for MolecularAtom
Source§fn clone(&self) -> MolecularAtom
fn clone(&self) -> MolecularAtom
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MolecularAtom
impl Debug for MolecularAtom
Source§impl Display for MolecularAtom
impl Display for MolecularAtom
Source§impl PartialEq for MolecularAtom
impl PartialEq for MolecularAtom
impl Eq for MolecularAtom
impl StructuralPartialEq for MolecularAtom
Auto Trait Implementations§
impl Freeze for MolecularAtom
impl RefUnwindSafe for MolecularAtom
impl Send for MolecularAtom
impl Sync for MolecularAtom
impl Unpin for MolecularAtom
impl UnsafeUnpin for MolecularAtom
impl UnwindSafe for MolecularAtom
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