pub struct H5partReader {
pub steps: Vec<H5PartStep>,
pub attributes: HashMap<String, String>,
}Expand description
Reader for the H5Part particle trajectory format.
H5Part stores particle data as an HDF5 file with one group per time step
(/Step#0, /Step#1, …). This implementation provides a pure-Rust
in-memory simulation of the format (no HDF5 C library required).
Fields§
§steps: Vec<H5PartStep>Loaded time steps (in order).
attributes: HashMap<String, String>Metadata attributes stored at file level.
Implementations§
Source§impl H5partReader
impl H5partReader
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Load a dataset from a byte slice simulating H5Part binary content.
In a real implementation this would call hdf5 crate APIs.
Here we parse a simple custom binary format for testing purposes.
Sourcepub fn step(&self, idx: usize) -> Option<&H5PartStep>
pub fn step(&self, idx: usize) -> Option<&H5PartStep>
Return the dataset at a specific step index, if present.
Sourcepub fn dataset_names(&self) -> Vec<String>
pub fn dataset_names(&self) -> Vec<String>
Return a list of dataset names available in the first step (if any).
Sourcepub fn push_step(&mut self, step: H5PartStep)
pub fn push_step(&mut self, step: H5PartStep)
Add a simulated time step (used for testing / programmatic construction).
Sourcepub fn iter_steps(&self) -> impl Iterator<Item = &H5PartStep>
pub fn iter_steps(&self) -> impl Iterator<Item = &H5PartStep>
Iterate over all steps.
Sourcepub fn step_near(&self, target_time: f64) -> Option<&H5PartStep>
pub fn step_near(&self, target_time: f64) -> Option<&H5PartStep>
Find the step closest to a given simulation time.
Trait Implementations§
Source§impl Clone for H5partReader
impl Clone for H5partReader
Source§fn clone(&self) -> H5partReader
fn clone(&self) -> H5partReader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for H5partReader
impl Debug for H5partReader
Source§impl Default for H5partReader
impl Default for H5partReader
Source§fn default() -> H5partReader
fn default() -> H5partReader
Auto Trait Implementations§
impl Freeze for H5partReader
impl RefUnwindSafe for H5partReader
impl Send for H5partReader
impl Sync for H5partReader
impl Unpin for H5partReader
impl UnsafeUnpin for H5partReader
impl UnwindSafe for H5partReader
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
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.