pub struct PrmtopFile {
pub version: String,
pub atoms: Vec<PrmtopAtom>,
pub bonds: Vec<PrmtopBond>,
pub angles: Vec<PrmtopAngle>,
pub extra_sections: HashMap<String, Vec<String>>,
}Expand description
AMBER topology file (prmtop / parm7) representation.
Only the most commonly used sections are modelled here; raw section data
for every other %FLAG is preserved in extra_sections.
Fields§
§version: StringVersion string from the %VERSION line.
atoms: Vec<PrmtopAtom>All atoms in topology order.
bonds: Vec<PrmtopBond>All covalent bonds.
angles: Vec<PrmtopAngle>All valence angles.
extra_sections: HashMap<String, Vec<String>>Raw text for unrecognised %FLAG sections.
Implementations§
Source§impl PrmtopFile
impl PrmtopFile
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty PrmtopFile.
Sourcepub fn write<W: Write>(&self, writer: &mut W) -> Result<(), AmberIoError>
pub fn write<W: Write>(&self, writer: &mut W) -> Result<(), AmberIoError>
Write the topology to any Write sink in a simplified prmtop-style
text format.
The output is intentionally human-readable rather than byte-perfect AMBER binary prmtop; it is suitable for round-trip testing.
Sourcepub fn read<R: Read>(reader: R) -> Result<Self, AmberIoError>
pub fn read<R: Read>(reader: R) -> Result<Self, AmberIoError>
Parse a simplified prmtop-style text produced by PrmtopFile::write.
Trait Implementations§
Source§impl Clone for PrmtopFile
impl Clone for PrmtopFile
Source§fn clone(&self) -> PrmtopFile
fn clone(&self) -> PrmtopFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PrmtopFile
impl Debug for PrmtopFile
Source§impl Default for PrmtopFile
impl Default for PrmtopFile
Source§fn default() -> PrmtopFile
fn default() -> PrmtopFile
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrmtopFile
impl RefUnwindSafe for PrmtopFile
impl Send for PrmtopFile
impl Sync for PrmtopFile
impl Unpin for PrmtopFile
impl UnsafeUnpin for PrmtopFile
impl UnwindSafe for PrmtopFile
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.