pub struct Hdf5FileImage {
pub version: u8,
pub group_segments: Vec<(String, String)>,
pub dataset_segments: Vec<(String, String, Vec<usize>, Vec<f64>)>,
pub attr_segments: Vec<(String, String, String, String)>,
}Expand description
A byte-oriented image of an in-memory HDF5 file.
Encodes groups, datasets and attributes into a compact binary representation for testing checkpoint / restart round-trip workflows.
Fields§
§version: u8Version tag.
group_segments: Vec<(String, String)>Serialised group segments: (path, attr_json).
dataset_segments: Vec<(String, String, Vec<usize>, Vec<f64>)>Serialised dataset segments: (group_path, name, shape, flat_f64).
attr_segments: Vec<(String, String, String, String)>Serialised attribute segments: (group, name, attr_name, value_str).
Implementations§
Source§impl Hdf5FileImage
impl Hdf5FileImage
Sourcepub fn from_file(file: &Hdf5File) -> Self
pub fn from_file(file: &Hdf5File) -> Self
Build an image from an Hdf5File.
Only datasets containing f64 data are captured; other dtypes are skipped.
Sourcepub fn restore_to_file(&self, file: &mut Hdf5File) -> Hdf5Result<()>
pub fn restore_to_file(&self, file: &mut Hdf5File) -> Hdf5Result<()>
Restore datasets from this image into a (possibly empty) Hdf5File.
Sourcepub fn n_datasets(&self) -> usize
pub fn n_datasets(&self) -> usize
Total number of dataset segments in the image.
Trait Implementations§
Source§impl Clone for Hdf5FileImage
impl Clone for Hdf5FileImage
Source§fn clone(&self) -> Hdf5FileImage
fn clone(&self) -> Hdf5FileImage
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 moreAuto Trait Implementations§
impl Freeze for Hdf5FileImage
impl RefUnwindSafe for Hdf5FileImage
impl Send for Hdf5FileImage
impl Sync for Hdf5FileImage
impl Unpin for Hdf5FileImage
impl UnsafeUnpin for Hdf5FileImage
impl UnwindSafe for Hdf5FileImage
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.