- docs/README.md links the improvement logs and June plans where the refresh archived them (docs/archive/). - clawhdf5-py README: 'r+' creates and replaces attributes (compact or dense); only deleting them is unsupported. - scripts/run-benchmarks.sh benchmarked the pre-rename rustyhdf5-format and overwrote BENCHMARKS.md; nothing referenced it. Removed. - Cargo.toml descriptions no longer name rustyhdf5/edgehdf5; clawhdf5-gpu says it is not HDF5 I/O. - benchmarks/cross_platform.sh pointed at a ROADMAP section that no longer exists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clawhdf5-derive
#[derive(H5Type)]: maps a Rust struct with named fields to an HDF5
compound datatype. The derive generates three inherent methods:
hdf5_datatype() -> clawhdf5_format::datatype::Datatype— theDatatype::Compound(members in field order, packed, little-endian);to_bytes(&self) -> Vec<u8>— one element in that layout;from_bytes(&[u8]) -> Self— the reverse (panics if the slice is shorter than the compound).
Supported field types: f32, f64, i8–i64, u8–u64, bool
(stored as u8) and fixed-size arrays [T; N] of those numeric types.
Tuple structs, enums and nested structs are refused at compile time.
The generated code names clawhdf5_format, so the crate using the derive
must depend on clawhdf5-format too. Not
on crates.io yet:
[dependencies]
clawhdf5-derive = { git = "https://git.redclaw.dev/quantumclaw/clawhdf5" }
clawhdf5-format = { git = "https://git.redclaw.dev/quantumclaw/clawhdf5" }
Example
use clawhdf5_derive::H5Type;
use clawhdf5_format::datatype::Datatype;
#[derive(H5Type, Debug, PartialEq)]
struct Point {
id: u32,
pos: [f64; 3],
valid: bool,
}
let p = Point { id: 7, pos: [1.0, 2.0, 3.0], valid: true };
let bytes = p.to_bytes();
assert_eq!(bytes.len(), 4 + 24 + 1);
assert_eq!(Point::from_bytes(&bytes), p);
assert!(matches!(Point::hdf5_datatype(), Datatype::Compound { size: 29, .. }));
Tests: crates/clawhdf5-format/tests/derive_tests.rs.
License
MIT