pub struct Atom {
pub name: String,
pub element: Element,
pub pos: Point,
}Expand description
Labeled atom with immutable element identity and mutable position.
The struct is shared across residue, chain, and structure builders. Keeping the element metadata close to the coordinate allows downstream algorithms (e.g., heavy-atom filters or hydrogen placement) to reason locally without traversing additional tables.
Fields§
§name: StringAtom name as it appears in crystallographic or modeling files (e.g., CA).
element: ElementChemical element derived from the periodic table definitions.
pos: PointCartesian coordinates measured in ångströms.
Implementations§
Source§impl Atom
impl Atom
Sourcepub fn new(name: &str, element: Element, pos: Point) -> Self
pub fn new(name: &str, element: Element, pos: Point) -> Self
Creates a new atom from a name, element, and position.
Caller controls ownership of the label string while the element enforces chemical consistency. The position is copied as-is; no normalization is performed.
§Arguments
name- Atom label such as"CA"or"OXT".element-Elementvariant describing the chemical identity.pos-Pointdescribing the Cartesian coordinates in ångströms.
§Returns
A fully initialized Atom instance.
Sourcepub fn distance_squared(&self, other: &Atom) -> f64
pub fn distance_squared(&self, other: &Atom) -> f64
Sourcepub fn translate_by(&mut self, vector: &Vector3<f64>)
pub fn translate_by(&mut self, vector: &Vector3<f64>)
Translates the atom by an arbitrary vector.
The operation mutates the underlying position and is commonly used during rigid-body transforms or when applying simulation displacements.
§Arguments
vector- Translation expressed as analgebra::Vector3<f64>in ångströms.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.