pub struct GroFile {
pub title: String,
pub atoms: Vec<GroAtom>,
pub box_vectors: [f64; 3],
}Expand description
Parsed representation of a GROMACS GRO file.
Fields§
§title: StringTitle / comment line.
atoms: Vec<GroAtom>Atom records.
box_vectors: [f64; 3]Orthorhombic box vectors in nm.
Implementations§
Source§impl GroFile
impl GroFile
Sourcepub fn read(reader: impl BufRead) -> Result<Self, String>
pub fn read(reader: impl BufRead) -> Result<Self, String>
Parse a GRO file from any BufRead source.
Sourcepub fn write(&self, writer: impl Write) -> Result<(), String>
pub fn write(&self, writer: impl Write) -> Result<(), String>
Serialize this GroFile to any Write sink.
Sourcepub fn from_xyz(positions: &[[f64; 3]], box_size: [f64; 3]) -> Self
pub fn from_xyz(positions: &[[f64; 3]], box_size: [f64; 3]) -> Self
Create a minimal GroFile from a slice of positions (nm).
All atoms get residue_name = "MOL", atom_name = "X", residue_id = 1.
Sourcepub fn positions_angstrom(&self) -> Vec<[f64; 3]>
pub fn positions_angstrom(&self) -> Vec<[f64; 3]>
Return all atom positions converted from nm to Angstrom (x10).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GroFile
impl RefUnwindSafe for GroFile
impl Send for GroFile
impl Sync for GroFile
impl Unpin for GroFile
impl UnsafeUnpin for GroFile
impl UnwindSafe for GroFile
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
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.