Skip to main content

Crate rustyhdf5

Crate rustyhdf5 

Source
Expand description

High-level API for reading and writing HDF5 files.

This crate provides an ergonomic interface on top of rustyhdf5-format.

§Reading

use rustyhdf5::File;

let file = File::open("data.h5").unwrap();
let ds = file.dataset("sensors/temperature").unwrap();
let values = ds.read_f64().unwrap();
println!("shape: {:?}, data: {:?}", ds.shape().unwrap(), values);

§Writing

use rustyhdf5::{FileBuilder, AttrValue};

let mut builder = FileBuilder::new();
builder.create_dataset("data").with_f64_data(&[1.0, 2.0, 3.0]);
builder.set_attr("version", AttrValue::I64(1));
builder.write("output.h5").unwrap();

Re-exports§

pub use error::Error;
pub use lazy::LazyDataset;
pub use lazy::LazyFile;
pub use lazy::LazyGroup;
pub use mmap_file::MmapDataset;
pub use mmap_file::MmapFile;
pub use mmap_file::MmapGroup;
pub use reader::Dataset;
pub use reader::File;
pub use reader::Group;
pub use types::DType;
pub use writer::FileBuilder;

Modules§

error
Error types for the high-level API.
lazy
Lazy file handle that only parses HDF5 metadata on demand.
mmap_file
Memory-mapped HDF5 file reader.
reader
Reading API: File, Dataset, and Group handles for reading HDF5 files.
types
Simplified type representations for the high-level API.
writer
Writing API: FileBuilder and GroupBuilder for creating HDF5 files.

Structs§

CompoundTypeBuilder
Builder for constructing HDF5 compound (struct) datatypes.
EnumTypeBuilder
Builder for constructing HDF5 enumeration datatypes.

Enums§

AttrValue
Convenient attribute values for the write API.