1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! Pure Rust HDF5 library with full read/write support.
//!
//! This crate provides a high-level API for creating and reading HDF5 files
//! without any C dependencies. It supports contiguous and chunked datasets,
//! deflate compression (with optional shuffle), SWMR streaming, and hyperslab
//! (slice) I/O.
//!
//! # Quick start
//!
//! ## Writing a dataset
//!
//! ```no_run
//! use rust_hdf5::H5File;
//!
//! let file = H5File::create("output.h5").unwrap();
//! let ds = file.new_dataset::<f64>()
//! .shape(&[100, 200])
//! .create("matrix")
//! .unwrap();
//! let data: Vec<f64> = (0..20_000).map(|i| i as f64).collect();
//! ds.write_raw(&data).unwrap();
//! file.close().unwrap();
//! ```
//!
//! ## Reading a dataset
//!
//! ```no_run
//! use rust_hdf5::H5File;
//!
//! let file = H5File::open("output.h5").unwrap();
//! let ds = file.dataset("matrix").unwrap();
//! let data = ds.read_raw::<f64>().unwrap();
//! assert_eq!(data.len(), 20_000);
//! ```
//!
//! ## Chunked + compressed streaming
//!
//! ```no_run
//! use rust_hdf5::H5File;
//!
//! let file = H5File::create("stream.h5").unwrap();
//! let ds = file.new_dataset::<f32>()
//! .shape(&[0usize, 64])
//! .chunk(&[1, 64])
//! .max_shape(&[None, Some(64)])
//! .deflate(6)
//! .create("sensor")
//! .unwrap();
//!
//! for frame in 0..1000u64 {
//! let vals: Vec<f32> = (0..64).map(|i| (frame * 64 + i) as f32).collect();
//! let raw: Vec<u8> = vals.iter().flat_map(|v| v.to_le_bytes()).collect();
//! ds.write_chunk(frame as usize, &raw).unwrap();
//! }
//! ds.extend(&[1000, 64]).unwrap();
//! file.close().unwrap();
//! ```
//!
//! ## Hyperslab (slice) I/O
//!
//! ```no_run
//! use rust_hdf5::H5File;
//!
//! // Write a sub-region
//! let file = H5File::create("slice.h5").unwrap();
//! let ds = file.new_dataset::<i32>()
//! .shape(&[10usize, 10])
//! .create("grid")
//! .unwrap();
//! ds.write_raw(&[0i32; 100]).unwrap();
//! ds.write_slice(&[2, 3], &[3, 4], &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]).unwrap();
//! file.close().unwrap();
//!
//! // Read a sub-region
//! let file = H5File::open("slice.h5").unwrap();
//! let ds = file.dataset("grid").unwrap();
//! let region = ds.read_slice::<i32>(&[2, 3], &[3, 4]).unwrap();
//! assert_eq!(region.len(), 12);
//! ```
// The crate reads and writes numeric values by transmuting host-native
// bytes (`H5Type` raw read/write paths) while always declaring a
// little-endian datatype on disk. That is correct only on a little-endian
// host; fail the build loudly on big-endian rather than corrupt data.
compile_error!;
pub
/// Private rayon thread pool (half the cores by default) for all internal
/// parallelism; only present under the `parallel` feature.
pub
/// The run-time SIMD level the filter kernels dispatch on; only present
/// under the `simd` feature.
pub
/// Zero-copy views of a dataset's stored bytes. Requires the `mmap` feature.
pub use ;
pub use ;
pub use ;
pub use ;
pub use CreationOrder;
pub use ;
pub use ;
pub use ;
pub use VirtualMapping;
pub use Reference;
pub use ;
pub use ;
pub use LibverBound;
pub use H5Group;
pub use ;
pub use ExternalFileSegment;
pub use LinkClass;
pub use SuperblockExtension;
pub use ;
pub use ;
pub use H5NamedDatatype;
pub use ;