[][src]Struct xdrfile::Frame

pub struct Frame {
    pub step: usize,
    pub time: f32,
    pub box_vector: [[f32; 3]; 3],
    pub coords: Vec<[f32; 3]>,
}

A frame represents a single step in a trajectory.

Fields

step: usize

Trajectory step

time: f32

Time step (usually in picoseconds)

box_vector: [[f32; 3]; 3]

3x3 box vector

coords: Vec<[f32; 3]>

3D coordinates for N atoms where N is num_atoms

Implementations

impl Frame[src]

pub fn new() -> Frame[src]

Creates an empty frame with a capacity of 0

pub fn with_len(num_atoms: usize) -> Frame[src]

Creates a frame with the given capacity

pub fn filter_coords(self: &mut Frame, indeces: &[usize])[src]

Filters the frame by removing all atoms not matching the given indeces.

pub fn len(self: &Frame) -> usize[src]

Length of the frame (number of atoms)

pub fn num_atoms(self: &Frame) -> usize[src]

The number of atoms in the frame

pub fn resize(&mut self, num_atoms: usize)[src]

Resize the frame to have exactly num_atoms atoms, filling coords with zeros if necessary

Trait Implementations

impl Clone for Frame[src]

impl Debug for Frame[src]

impl Default for Frame[src]

Auto Trait Implementations

impl RefUnwindSafe for Frame

impl Send for Frame

impl Sync for Frame

impl Unpin for Frame

impl UnwindSafe for Frame

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.