Skip to main content

HDF5Dataset

Struct HDF5Dataset 

Source
pub struct HDF5Dataset { /* private fields */ }
Expand description

An HDF5 dataset — a typed, shaped, chunked (or contiguous) array of data.

Provides synchronous access to parsed metadata (shape, dtype, chunk shape, filters, fill value) and async access to the chunk index (byte offsets of all chunks in the file).

Implementations§

Source§

impl HDF5Dataset

Source

pub fn new( name: String, header: ObjectHeader, reader: Arc<dyn AsyncFileReader>, raw_reader: Arc<dyn AsyncFileReader>, superblock: Arc<Superblock>, ) -> Result<Self>

Create a new dataset by parsing metadata messages from its object header.

Source

pub fn name(&self) -> &str

The dataset’s name (not the full path).

Source

pub fn shape(&self) -> &[u64]

Dataset shape (current dimensions).

Source

pub fn ndim(&self) -> usize

Number of dimensions.

Source

pub fn dtype(&self) -> &DataType

Data type.

Source

pub fn element_size(&self) -> u32

Element size in bytes.

Source

pub fn chunk_shape(&self) -> Option<&[u64]>

Chunk shape (None for contiguous or compact storage).

Source

pub fn filters(&self) -> &FilterPipeline

Filter pipeline.

Source

pub fn fill_value(&self) -> Option<&[u8]>

Fill value bytes (interpretation depends on dtype).

Source

pub fn layout(&self) -> &StorageLayout

Storage layout.

Source

pub fn is_null_dataspace(&self) -> bool

Whether this dataset has a null dataspace (no data, type 2).

Source

pub fn has_external_storage(&self) -> bool

Whether this dataset uses external data files (msg type 0x0007).

Source

pub fn header(&self) -> &ObjectHeader

Access the object header.

Source

pub async fn attributes(&self) -> Vec<Attribute>

Get all attributes attached to this dataset, resolving vlen data.

Source

pub async fn attribute(&self, name: &str) -> Option<Attribute>

Get a single attribute by name.

Source

pub async fn chunk_index(&self) -> Result<&ChunkIndex>

Extract the chunk index, caching the result after first resolution.

For chunked datasets, traverses the B-tree to enumerate all chunks. For contiguous datasets, returns a single-entry index. For compact datasets, returns an empty index (data is inline in the header).

Source

pub async fn batch_get_chunks( &self, chunk_indices: &[Vec<u64>], ) -> Result<Vec<Option<Bytes>>>

Fetch multiple chunks in a single batched I/O call.

Looks up byte ranges from the chunk index and fetches them all via raw_reader.get_byte_ranges(), bypassing the BlockCache.

Returns one entry per input index, in the same order. Chunks that are not present in the index (unallocated) are returned as None.

Source

pub async fn batch_fetch_ranges( &self, ranges: &[(u64, u64)], ) -> Result<Vec<Bytes>>

Fetch multiple byte ranges in a single batched I/O call.

Unlike batch_get_chunks, this takes pre-resolved (offset, length) pairs — no chunk index lookup is performed. Use this when the caller has already resolved the chunk index and wants to avoid re-parsing.

Trait Implementations§

Source§

impl Debug for HDF5Dataset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more