Skip to main content

Dataset

Struct Dataset 

Source
pub struct Dataset<'f> { /* private fields */ }
Expand description

A dataset within an HDF5 file.

Implementations§

Source§

impl<'f> Dataset<'f>

Source

pub fn name(&self) -> &str

Dataset name.

Source

pub fn address(&self) -> u64

The object header address used to parse this dataset. Useful as an opaque identifier or for NC4 data_offset.

Source

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

Shape of the dataset (dimensions).

Source

pub fn dtype(&self) -> &Datatype

Datatype of the dataset.

Source

pub fn ndim(&self) -> usize

Number of dimensions.

Source

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

Maximum dimension sizes, if defined. u64::MAX indicates unlimited.

Source

pub fn chunks(&self) -> Option<Vec<u32>>

Chunk dimensions, if the dataset is chunked.

Source

pub fn fill_value(&self) -> Option<&FillValueMessage>

Fill value, if defined.

Source

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

Dataset attributes.

Source

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

Find an attribute by name.

Source

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.

Source

pub fn read_strings(&self) -> Result<Vec<String>>

Read all string elements from a string-typed dataset.

Source

pub fn num_elements(&self) -> u64

Total number of elements in the dataset.

Source

pub fn read_array<T: H5Type>(&self) -> Result<ArrayD<T>>

Read the entire dataset into an n-dimensional array.

Source

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.

Source

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.

Source

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.

Source

pub fn read_slice<T: H5Type>(&self, selection: &SliceInfo) -> Result<ArrayD<T>>

Read a hyperslab of the dataset.

Auto Trait Implementations§

§

impl<'f> Freeze for Dataset<'f>

§

impl<'f> !RefUnwindSafe for Dataset<'f>

§

impl<'f> Send for Dataset<'f>

§

impl<'f> Sync for Dataset<'f>

§

impl<'f> Unpin for Dataset<'f>

§

impl<'f> UnsafeUnpin for Dataset<'f>

§

impl<'f> !UnwindSafe for Dataset<'f>

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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.