pub struct System {
pub atoms: Vec<Atom>,
pub bonds: Vec<Bond>,
pub box_vectors: Option<[[f64; 3]; 3]>,
pub bio_metadata: Option<BioMetadata>,
}Expand description
A complete molecular system.
Contains all information needed to represent a molecular structure: atoms with their positions, connectivity through bonds, optional periodic boundary conditions, and optional biological metadata for biomolecular systems.
§Fields
atoms— Vector of atoms with element types and positionsbonds— Vector of bonds defining molecular connectivitybox_vectors— Optional 3×3 matrix defining periodic cell vectorsbio_metadata— Optional biological annotation (residues, chains)
§Examples
use dreid_forge::{Atom, Bond, BondOrder, Element, System};
// Build a simple CO molecule
let mut system = System::new();
system.atoms.push(Atom::new(Element::C, [0.0, 0.0, 0.0]));
system.atoms.push(Atom::new(Element::O, [1.128, 0.0, 0.0]));
system.bonds.push(Bond::new(0, 1, BondOrder::Triple));
assert_eq!(system.atom_count(), 2);
assert_eq!(system.bond_count(), 1);
assert!(!system.is_periodic());Fields§
§atoms: Vec<Atom>Atoms in the system with element types and positions.
bonds: Vec<Bond>Bonds defining molecular connectivity.
box_vectors: Option<[[f64; 3]; 3]>Periodic cell vectors as row-major 3×3 matrix, if periodic.
bio_metadata: Option<BioMetadata>Biological metadata (residue info, chains) for biomolecules.
Implementations§
Source§impl System
impl System
Sourcepub fn atom_count(&self) -> usize
pub fn atom_count(&self) -> usize
Returns the number of atoms in the system.
Sourcepub fn bond_count(&self) -> usize
pub fn bond_count(&self) -> usize
Returns the number of bonds in the system.
Sourcepub fn is_periodic(&self) -> bool
pub fn is_periodic(&self) -> bool
Returns true if the system has periodic boundary conditions.
A system is periodic if box_vectors is Some.
Sourcepub fn has_bio_metadata(&self) -> bool
pub fn has_bio_metadata(&self) -> bool
Returns true if the system has biological metadata attached.
Biological metadata includes residue names, chain IDs, and other annotations from PDB/mmCIF files.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for System
impl RefUnwindSafe for System
impl Send for System
impl Sync for System
impl Unpin for System
impl UnwindSafe for System
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<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.