pub struct HDF5File { /* private fields */ }Expand description
HDF5 file handle
Implementations§
Source§impl HDF5File
impl HDF5File
Sourcepub fn open<P: AsRef<Path>>(path: P, mode: FileMode) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P, mode: FileMode) -> Result<Self>
Open an existing HDF5 file
Sourcepub fn create_dataset_from_array<A, D>(
&mut self,
path: &str,
array: &ArrayBase<A, D>,
options: Option<DatasetOptions>,
) -> Result<()>
pub fn create_dataset_from_array<A, D>( &mut self, path: &str, array: &ArrayBase<A, D>, options: Option<DatasetOptions>, ) -> Result<()>
Create a dataset from an ndarray
Sourcepub fn read_dataset_typed<T>(&self, path: &str) -> Result<ArrayD<T>>
pub fn read_dataset_typed<T>(&self, path: &str) -> Result<ArrayD<T>>
Read a dataset as an ndarray with specific type
Sourcepub fn read_dataset(&self, path: &str) -> Result<ArrayD<f64>>
pub fn read_dataset(&self, path: &str) -> Result<ArrayD<f64>>
Read a dataset as an ndarray of f64
Sourcepub fn get_dataset(&self, path: &str) -> Result<&Dataset>
pub fn get_dataset(&self, path: &str) -> Result<&Dataset>
Get a dataset by path (e.g., “/group1/group2/dataset”)
Sourcepub fn get_group(&self, path: &str) -> Result<&Group>
pub fn get_group(&self, path: &str) -> Result<&Group>
Get a group by path (e.g., “/group1/group2”)
Sourcepub fn list_datasets(&self) -> Vec<String>
pub fn list_datasets(&self) -> Vec<String>
List all datasets in the file recursively
Sourcepub fn list_groups(&self) -> Vec<String>
pub fn list_groups(&self) -> Vec<String>
List all groups in the file recursively
Sourcepub fn create_group(&mut self, name: &str) -> Result<()>
pub fn create_group(&mut self, name: &str) -> Result<()>
Create a group in the root - delegation method
Sourcepub fn set_attribute(
&mut self,
name: &str,
key: &str,
value: AttributeValue,
) -> Result<()>
pub fn set_attribute( &mut self, name: &str, key: &str, value: AttributeValue, ) -> Result<()>
Set an attribute on the file root - delegation method
Sourcepub fn get_attribute(
&self,
name: &str,
key: &str,
) -> Result<Option<&AttributeValue>>
pub fn get_attribute( &self, name: &str, key: &str, ) -> Result<Option<&AttributeValue>>
Get an attribute from the file root - delegation method
Sourcepub fn write_dataset_slice<T>(
&mut self,
name: &str,
data: &[T],
offset: &[usize],
) -> Result<()>
pub fn write_dataset_slice<T>( &mut self, name: &str, data: &[T], offset: &[usize], ) -> Result<()>
Write a slice of data to a dataset
Sourcepub fn read_dataset_slice<T>(
&self,
name: &str,
shape: &[usize],
offset: &[usize],
) -> Result<Vec<T>>
pub fn read_dataset_slice<T>( &self, name: &str, shape: &[usize], offset: &[usize], ) -> Result<Vec<T>>
Read a slice of data from a dataset
Sourcepub fn list_all_items(&self) -> Vec<String>
pub fn list_all_items(&self) -> Vec<String>
List all items (groups and datasets) recursively
Auto Trait Implementations§
impl Freeze for HDF5File
impl RefUnwindSafe for HDF5File
impl Send for HDF5File
impl Sync for HDF5File
impl Unpin for HDF5File
impl UnwindSafe for HDF5File
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.