Struct MolecularAtom
pub struct MolecularAtom { /* private fields */ }Expand description
An explicit atom entry in a molecule.
Implementations§
§impl MolecularAtom
impl MolecularAtom
pub fn new(label: &str) -> Result<MolecularAtom, MoleculeValidationError>
pub fn new(label: &str) -> Result<MolecularAtom, 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.
pub const fn id(&self) -> Option<&MolecularAtomId>
pub const fn id(&self) -> Option<&MolecularAtomId>
Returns the optional atom identifier.
pub fn with_id(self, id: MolecularAtomId) -> MolecularAtom
pub fn with_id(self, id: MolecularAtomId) -> MolecularAtom
Sets the atom identifier from a validated value.
pub fn try_with_id(
self,
id: &str,
) -> Result<MolecularAtom, MoleculeValidationError>
pub fn try_with_id( self, id: &str, ) -> Result<MolecularAtom, MoleculeValidationError>
Sets the atom identifier after validation.
§Errors
Returns MoleculeValidationError::EmptyAtomId when id is empty after trimming.
Trait Implementations§
§impl Clone for MolecularAtom
impl Clone for MolecularAtom
§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 more§impl Debug for MolecularAtom
impl Debug for MolecularAtom
§impl Display for MolecularAtom
impl Display for MolecularAtom
§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