Skip to main content

Module attribute

Module attribute 

Source
Expand description

Attribute support.

Attributes are small metadata items attached to datasets (or groups). They are created via the AttrBuilder API obtained from H5Dataset::new_attr.

§Example

use rust_hdf5::H5File;
use rust_hdf5::types::VarLenUnicode;

let file = H5File::create("attrs.h5").unwrap();
let ds = file.new_dataset::<f32>().shape(&[10]).create("data").unwrap();
let attr = ds.new_attr::<VarLenUnicode>().shape(()).create("units").unwrap();
attr.write_scalar(&VarLenUnicode("meters".to_string())).unwrap();

Structs§

AttrBuilder
A fluent builder for creating attributes on datasets.
H5Attribute
A handle to an HDF5 attribute.