Expand description
Pure-Rust HDF5 writer.
Build a file from DatasetBuilders and AttributeBuilders with
Hdf5Builder, turn it into an Hdf5WritePlan, and serialize it with
Hdf5Writer (a seekable sink) or Hdf5WritePlan::encode (bytes):
use std::io::Cursor;
use hdf5_writer::{DatasetBuilder, Hdf5Builder, Hdf5Writer, WriteOptions};
let plan = Hdf5Builder::new()
.dataset(DatasetBuilder::typed_data("grid", vec![2, 3], &[0_i32, 1, 2, 3, 4, 5]).unwrap())
.into_plan()
.unwrap();
let bytes = Hdf5Writer::new(Cursor::new(Vec::new()), WriteOptions::default())
.finish(plan)
.unwrap()
.into_inner();
assert_eq!(&bytes[..8], b"\x89HDF\r\n\x1a\n");Supported: superblock v2; contiguous, compact, and chunked layouts (implicit, single-chunk, fixed-array, and version-2 B-tree indices, the last for unlimited maximum dimensions); groups; attributes; the deflate, shuffle, and fletcher32 filters; and fixed-point, floating-point, string (fixed and variable-length), reference, variable-length, bitfield, opaque, compound, enum, and array datatypes. Output is validated against libhdf5.
Structs§
- Attribute
Builder - Attribute definition used by HDF5 object headers. Builds a single HDF5 attribute attached to a dataset, group, or the file root. Supports scalars, vectors, fixed and variable-length strings, object references, and reference lists.
- Compound
Field - A field within a compound datatype.
- Dataset
Builder - Dataset definition used by the write planner. Builds a single HDF5 dataset: its name/path, datatype, shape, layout (contiguous, compact, or chunked), optional max shape, filters, fill value, data, and attributes.
- Dataspace
Message - Parsed dataspace message.
- Enum
Member - A member of an enumeration.
- Fill
Value Message - Parsed fill value message.
- Filter
Description - A single filter in a filter pipeline.
- Filter
Pipeline Message - Parsed filter pipeline message.
- Group
Attribute Builder - Attribute attached to an HDF5 group addressed by relative path.
- Hdf5
Builder - Root HDF5 file builder.
Accumulates datasets, root attributes, and group attributes, then produces
a validated
Hdf5WritePlanviaHdf5Builder::into_plan. - Hdf5
Write Plan - Validated HDF5 write plan.
A validated set of datasets and attributes ready to be serialized by
Hdf5WriterorHdf5WritePlan::encode. - Hdf5
Writer - Writes an
Hdf5WritePlanto a seekable sink. UseHdf5WritePlan::encodewhen the sink is a plainWrite. - Write
Options - Configuration for HDF5 writes.
Enums§
- Byte
Order - Byte order for numeric data.
- Chunk
Indexing - Chunk indexing method for v4/v5 layout messages.
- Data
Layout - Raw data storage layout for a dataset.
- Dataspace
Type - HDF5 dataspace kind.
- Datatype
- Describes the element type of a dataset or attribute.
- Error
- HDF5 writer errors.
- Fill
Time - When to write the fill value.
- Hdf5
Variant - HDF5 file variant emitted by the writer.
- Planned
Layout - Reference
Type - HDF5 reference type.
- String
Encoding - String character encoding.
- String
Padding - String padding type.
- String
Size - How a string’s length is determined.
- VarLen
Kind - HDF5 variable-length datatype flavor.
Constants§
- FILTER_
DEFLATE - Standard HDF5 filter IDs.
- FILTER_
FLETCHE R32 - FILTER_
LZ4 - FILTER_
NBIT - FILTER_
SCALEOFFSET - FILTER_
SHUFFLE - FILTER_
SZIP - UNLIMITED
- Unlimited dimension sentinel value.
Traits§
- H5Write
Element - Primitive element types that can be encoded into contiguous HDF5 raw data.
- H5Write
Type - Trait for Rust types that can describe their HDF5 on-disk datatype.
Functions§
- fletcher32
- Fletcher-32 checksum used by the HDF5 filter pipeline.
- jenkins_
lookup3 - Jenkins lookup3
hashlittle2used by HDF5 metadata checksums.