pub struct BinaryTrajectoryReader {
pub header: BinaryHeader,
/* private fields */
}Expand description
Reader for the OxiPhysics binary trajectory format.
Fields§
§header: BinaryHeaderParsed file header.
Implementations§
Source§impl BinaryTrajectoryReader
impl BinaryTrajectoryReader
Sourcepub fn new(buf: Vec<u8>) -> Option<Self>
pub fn new(buf: Vec<u8>) -> Option<Self>
Create a reader from a byte buffer.
Returns None if the header is invalid or magic bytes mismatch.
Sourcepub fn read_frame(&mut self) -> Option<ParticleFrame>
pub fn read_frame(&mut self) -> Option<ParticleFrame>
Read the next frame sequentially.
Returns None when no more frames are available.
Sourcepub fn seek_frame(&mut self, i: usize)
pub fn seek_frame(&mut self, i: usize)
Seek to frame index i (0-based).
Does nothing if i is out of range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BinaryTrajectoryReader
impl RefUnwindSafe for BinaryTrajectoryReader
impl Send for BinaryTrajectoryReader
impl Sync for BinaryTrajectoryReader
impl Unpin for BinaryTrajectoryReader
impl UnsafeUnpin for BinaryTrajectoryReader
impl UnwindSafe for BinaryTrajectoryReader
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<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.