pub struct Dataset { /* private fields */ }Expand description
A dataset within an HDF5 file.
Implementations§
Source§impl Dataset
impl Dataset
Sourcepub fn address(&self) -> u64
pub fn address(&self) -> u64
The object header address used to parse this dataset. Useful as an opaque identifier or for NC4 data_offset.
Sourcepub fn max_dims(&self) -> Option<&[u64]>
pub fn max_dims(&self) -> Option<&[u64]>
Maximum dimension sizes, if defined. u64::MAX indicates unlimited.
Sourcepub fn iter_chunks(&self) -> Result<DatasetChunkIterator>
pub fn iter_chunks(&self) -> Result<DatasetChunkIterator>
Iterate over decoded chunks for a chunked dataset.
Sourcepub fn chunk_cache_stats(&self) -> ChunkCacheStats
pub fn chunk_cache_stats(&self) -> ChunkCacheStats
Return current chunk-cache statistics for this dataset’s file.
Sourcepub fn fill_value(&self) -> Option<&FillValueMessage>
pub fn fill_value(&self) -> Option<&FillValueMessage>
Fill value, if defined.
Sourcepub fn attributes(&self) -> Vec<Attribute>
pub fn attributes(&self) -> Vec<Attribute>
Dataset attributes.
Sourcepub fn read_string(&self) -> Result<String>
pub fn read_string(&self) -> Result<String>
Read a scalar string dataset or single string element.
Use Dataset::read_strings when the dataset contains multiple strings.
Sourcepub fn read_strings(&self) -> Result<Vec<String>>
pub fn read_strings(&self) -> Result<Vec<String>>
Read all string elements from a string-typed dataset.
Sourcepub fn num_elements(&self) -> u64
pub fn num_elements(&self) -> u64
Total number of elements in the dataset.
Sourcepub fn read_array<T: H5Type>(&self) -> Result<ArrayD<T>>
pub fn read_array<T: H5Type>(&self) -> Result<ArrayD<T>>
Read the entire dataset into an n-dimensional array.
Sourcepub fn read_into<T: H5Type>(&self, dst: &mut [T]) -> Result<()>
pub fn read_into<T: H5Type>(&self, dst: &mut [T]) -> Result<()>
Read the entire dataset into a caller-provided typed buffer.
Sourcepub fn read_array_parallel<T: H5Type>(&self) -> Result<ArrayD<T>>
pub fn read_array_parallel<T: H5Type>(&self) -> Result<ArrayD<T>>
Read the entire dataset using internal chunk-level parallelism when possible.
Non-chunked datasets fall back to read_array.
Sourcepub fn read_array_in_pool<T: H5Type>(
&self,
pool: &ThreadPool,
) -> Result<ArrayD<T>>
pub fn read_array_in_pool<T: H5Type>( &self, pool: &ThreadPool, ) -> Result<ArrayD<T>>
Read the entire dataset using the provided Rayon thread pool.
Non-chunked datasets fall back to read_array.
Sourcepub fn read_slice_parallel<T: H5Type>(
&self,
selection: &SliceInfo,
) -> Result<ArrayD<T>>
pub fn read_slice_parallel<T: H5Type>( &self, selection: &SliceInfo, ) -> Result<ArrayD<T>>
Read a hyperslab of the dataset using chunk-level parallelism when possible.
Chunked datasets decompress overlapping chunks in parallel via Rayon.
Non-chunked layouts fall back to read_slice.
Sourcepub fn read_slice<T: H5Type>(&self, selection: &SliceInfo) -> Result<ArrayD<T>>
pub fn read_slice<T: H5Type>(&self, selection: &SliceInfo) -> Result<ArrayD<T>>
Read a hyperslab of the dataset.
Sourcepub fn read_raw_bytes(&self) -> Result<Vec<u8>>
pub fn read_raw_bytes(&self) -> Result<Vec<u8>>
Read the dataset as logical element bytes.
The returned bytes are after layout handling, chunk decompression, filter decoding, external raw-data resolution, and fill-value materialization. Numeric values remain in the dataset datatype’s byte order.
Sourcepub fn raw_byte_len(&self) -> Result<usize>
pub fn raw_byte_len(&self) -> Result<usize>
Number of logical raw bytes in the entire dataset.
Sourcepub fn read_raw_bytes_into(&self, dst: &mut [u8]) -> Result<()>
pub fn read_raw_bytes_into(&self, dst: &mut [u8]) -> Result<()>
Read logical raw bytes into a caller-provided buffer.
The destination length must match Dataset::raw_byte_len. Numeric
values remain in the dataset datatype’s byte order.
Sourcepub fn read_native_bytes(&self) -> Result<Vec<u8>>
pub fn read_native_bytes(&self) -> Result<Vec<u8>>
Read logical raw bytes converted to native-endian numeric fields.
Sourcepub fn read_native_bytes_into(&self, dst: &mut [u8]) -> Result<()>
pub fn read_native_bytes_into(&self, dst: &mut [u8]) -> Result<()>
Read logical raw bytes into a buffer and convert numeric fields to native endian.
Sourcepub fn vlen_reference_size(&self) -> usize
pub fn vlen_reference_size(&self) -> usize
Size in bytes of one HDF5 variable-length reference in this file.
Sourcepub fn raw_element_size(&self) -> usize
pub fn raw_element_size(&self) -> usize
Size in bytes of one logical raw element in this file.
Variable-length strings and sequences are stored as global-heap references whose width depends on the file offset size.
Sourcepub fn resolve_vlen_reference_bytes(
&self,
reference: &[u8],
base_element_size: usize,
) -> Result<Vec<u8>>
pub fn resolve_vlen_reference_bytes( &self, reference: &[u8], base_element_size: usize, ) -> Result<Vec<u8>>
Resolve one HDF5 variable-length reference into logical element bytes.
base_element_size is the byte width of one value in the vlen sequence.
The sequence length stored in the reference is interpreted as an element
count and multiplied by this size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dataset
impl !RefUnwindSafe for Dataset
impl Send for Dataset
impl Sync for Dataset
impl Unpin for Dataset
impl UnsafeUnpin for Dataset
impl !UnwindSafe for Dataset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more