pub struct MolRec {
pub meta: Value,
pub frame: Frame,
pub trajectory: Option<Trajectory>,
pub observables: BTreeMap<String, ObservableRecord>,
pub method: Value,
pub parameters: Value,
}Expand description
Single logical MolRec object.
Fields§
§meta: ValueRecord-level metadata.
frame: FrameCanonical frame.
trajectory: Option<Trajectory>Optional trajectory states.
observables: BTreeMap<String, ObservableRecord>Named observables.
method: ValueMethod-level metadata.
parameters: ValueParameter metadata.
Implementations§
Source§impl MolRec
impl MolRec
Sourcepub fn from_frames(frame: Frame, frames: Vec<Frame>) -> MolRec
pub fn from_frames(frame: Frame, frames: Vec<Frame>) -> MolRec
Build a MolRec from one canonical frame plus explicit trajectory states.
Sourcepub fn from_trajectory(trajectory: Trajectory) -> Result<MolRec, MolRsError>
pub fn from_trajectory(trajectory: Trajectory) -> Result<MolRec, MolRsError>
Build a MolRec from a dedicated trajectory object.
The canonical frame defaults to the first trajectory frame.
Sourcepub fn count_frames(&self) -> usize
pub fn count_frames(&self) -> usize
Total number of accessible frames.
Sourcepub fn add_frame(&mut self, frame: Frame)
pub fn add_frame(&mut self, frame: Frame)
Append one frame to the trajectory, creating it if needed.
Sourcepub fn set_trajectory(&mut self, trajectory: Option<Trajectory>)
pub fn set_trajectory(&mut self, trajectory: Option<Trajectory>)
Replace the trajectory.
Sourcepub fn add_observable(
&mut self,
observable: ObservableRecord,
) -> Option<ObservableRecord>
pub fn add_observable( &mut self, observable: ObservableRecord, ) -> Option<ObservableRecord>
Insert or replace an observable by name.
Sourcepub fn get_observable(&self, name: &str) -> Option<&ObservableRecord>
pub fn get_observable(&self, name: &str) -> Option<&ObservableRecord>
Borrow an observable by name.
Sourcepub fn remove_observable(&mut self, name: &str) -> Option<ObservableRecord>
pub fn remove_observable(&mut self, name: &str) -> Option<ObservableRecord>
Remove an observable by name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MolRec
impl !RefUnwindSafe for MolRec
impl Send for MolRec
impl Sync for MolRec
impl Unpin for MolRec
impl UnsafeUnpin for MolRec
impl !UnwindSafe for MolRec
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