pub struct File { /* private fields */ }Expand description
An open HDF5 file for reading.
When the mmap feature is enabled (the default), File::open uses
memory-mapped I/O so the OS page-cache serves reads with zero copies.
Use File::open_buffered to get the old read-into-Vec<u8> behaviour,
or File::from_bytes for fully in-memory operation.
Implementations§
Source§impl File
impl File
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Open an HDF5 file from a filesystem path.
When the mmap feature is enabled (default), this uses memory-mapped
I/O. Otherwise it reads the entire file into a Vec<u8>.
Sourcepub fn open_buffered<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn open_buffered<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Open an HDF5 file by reading it entirely into memory.
This is the pre-mmap behaviour and is useful when memory-mapping is undesirable (e.g. network filesystems, very small files, etc.).
Sourcepub fn from_bytes(data: Vec<u8>) -> Result<Self, Error>
pub fn from_bytes(data: Vec<u8>) -> Result<Self, Error>
Open an HDF5 file from an in-memory byte vector.
Sourcepub fn dataset(&self, path: &str) -> Result<Dataset<'_>, Error>
pub fn dataset(&self, path: &str) -> Result<Dataset<'_>, Error>
Resolve a path and return a Dataset handle.
The path uses / separators (e.g., "group1/values").
Sourcepub fn group(&self, path: &str) -> Result<Group<'_>, Error>
pub fn group(&self, path: &str) -> Result<Group<'_>, Error>
Resolve a path and return a Group handle.
The path uses / separators (e.g., "sensors").
Use "/" or "" for the root group.
Sourcepub fn superblock(&self) -> &Superblock
pub fn superblock(&self) -> &Superblock
Returns a reference to the parsed superblock.