A parser often learns where the next structures are (a node's children, a structure's body once its prefix gives its length) before it reads them one at a time. Over openUrl's restartable reader a structure only reached after a miss costs a pass, and a round trip, of its own. - clawhdf5-format: `Storage::hint(offset, len)`, "about to be read by this operation". Default: nothing (every backend that reads when asked); `&T`, `Box`, `Arc` and the facade's `FileData` forward it (shifted past a user block, clamped to the file). - clawhdf5-wasm `LazyStorage` records hinted blocks it lacks. A pass that misses nothing ignores them (a hint never adds a round trip); a pass that misses also asks for them, in file order, while the pass stays within what is left of the operation's `maxFetch` budget (a hint never makes a call fail). At most 1 MiB (or a block) per hint and 65536 blocks per pass are recorded, whatever a file makes a parser hint. `Operation::attempt` follows hints; the plain `LazyStorage::attempt` does not. `run_blocking` and the browser's driver use the former. `LazyStats::hinted_blocks` counts them. No parser hints yet: results, passes and requests are unchanged. Tests: hinted blocks come with a miss and never alone (cached ones skipped, a plain attempt ignores them), and stay within the fetch budget, a hint past the end or longer than the file harmless. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clawhdf5-format
Pure-Rust HDF5 binary format parsing and writing — no C dependencies.
Features
- Zero-copy superblock, object header, and B-tree parsing
- Chunked dataset read/write with filter pipelines
no_stdsupport (disablestdfeature)- Optional parallel reads via Rayon
- SHA-256 provenance tracking
Usage
use clawhdf5_format::Superblock;
let data = std::fs::read("data.h5").unwrap();
let sb = Superblock::from_bytes(&data).unwrap();
println!("HDF5 version {}.{}", sb.version_major(), sb.version_minor());
License
MIT