Skip to main content

EaGeometry

Struct EaGeometry 

Source
pub struct EaGeometry {
    pub idx_blk_elmts: u64,
    pub data_blk_min_elmts: u64,
    pub dblk_page_nelmts: u64,
    pub iblock_nsblks: usize,
    pub ndblk_addrs: usize,
    pub nsblk_addrs: usize,
    pub sblk: Vec<EaSblkInfo>,
}
Expand description

Extensible-array geometry derived from the creation parameters, matching the libhdf5 on-disk layout (H5EA__hdr_init, H5EAiblock.c).

Fields§

§idx_blk_elmts: u64§data_blk_min_elmts: u64§dblk_page_nelmts: u64

Elements per data block page (paging threshold).

§iblock_nsblks: usize

Super blocks whose data-block addresses live in the index block.

§ndblk_addrs: usize

Data-block address slots in the index block.

§nsblk_addrs: usize

Super-block address slots in the index block.

§sblk: Vec<EaSblkInfo>

Per-super-block layout, length = total super-block count.

Implementations§

Source§

impl EaGeometry

Source

pub fn new( idx_blk_elmts: u8, data_blk_min_elmts: u8, sup_blk_min_data_ptrs: u8, max_nelmts_bits: u8, max_dblk_page_nelmts_bits: u8, ) -> FormatResult<Self>

Derive the geometry from the EA creation parameters.

All parameters originate from a decoded file (the data-layout message), so this validates them and returns a FormatError rather than panicking on malformed or hostile input.

Source

pub fn sblk_index(&self, idx: u64) -> usize

Super-block index containing chunk idx (idx >= idx_blk_elmts).

Source

pub fn is_sblk_paged(&self, u: usize) -> bool

Whether super block u’s data blocks are paged (data block larger than one page).

Source

pub fn npages(&self, u: usize) -> u64

Number of pages in each data block of super block u.

Source

pub fn dblk_page_init_size(&self, u: usize) -> usize

Size of the page-init bitmap for one data block of super block u.

Source

pub fn dblk_page_size(&self, raw_elmt_size: usize) -> usize

On-disk size of one data block page (H5EA_DBLK_PAGE_SIZE).

Source

pub fn dblk_prefix_size(&self, sizeof_addr: u8, max_nelmts_bits: u8) -> usize

On-disk size of a data block prefix (H5EA_DBLOCK_PREFIX_SIZE): magic + version + class + header addr + block offset + checksum.

Source

pub fn locate(&self, idx: u64) -> FormatResult<EaLoc>

Locate chunk idx within the array.

Returns an error when idx exceeds the array’s capacity (rather than panicking on an out-of-bounds super-block index).

Trait Implementations§

Source§

impl Clone for EaGeometry

Source§

fn clone(&self) -> EaGeometry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EaGeometry

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.