pub struct FixedArrayHeader {
pub client_id: u8,
pub element_size: u8,
pub max_dblk_page_nelmts_bits: u8,
pub num_elmts: u64,
pub data_blk_addr: u64,
}Expand description
Fixed array header.
On-disk layout:
"FAHD"(4) + version=0(1) + client_id(1)
+ element_size(1) + max_dblk_page_nelmts_bits(1)
+ num_elmts(sizeof_size)
+ data_blk_addr(sizeof_addr)
+ checksum(4)Fields§
§client_id: u8§element_size: u8§max_dblk_page_nelmts_bits: u8§num_elmts: u64§data_blk_addr: u64Implementations§
Source§impl FixedArrayHeader
impl FixedArrayHeader
Sourcepub fn new_for_chunks(ctx: &FormatContext, num_elmts: u64) -> Self
pub fn new_for_chunks(ctx: &FormatContext, num_elmts: u64) -> Self
Create a new header for unfiltered chunk indexing.
Sourcepub fn new_for_filtered_chunks(
ctx: &FormatContext,
num_elmts: u64,
chunk_size_len: u8,
) -> Self
pub fn new_for_filtered_chunks( ctx: &FormatContext, num_elmts: u64, chunk_size_len: u8, ) -> Self
Create a new header for filtered chunk indexing.
chunk_size_len is the number of bytes needed to encode the chunk size
(typically computed from the maximum possible compressed chunk size).
Sourcepub fn dblk_page_nelmts(&self) -> u64
pub fn dblk_page_nelmts(&self) -> u64
Number of elements per data block page (1 << max_dblk_page_nelmts_bits).
Mirrors dblk_page_nelmts in libhdf5 (H5FAcache.c).
Sourcepub fn is_paged(&self) -> bool
pub fn is_paged(&self) -> bool
Whether the data block for this array is paged.
A data block is paged when num_elmts > dblk_page_nelmts
(H5FAcache.c: if (hdr->cparam.nelmts > dblk_page_nelmts)).
Sourcepub fn npages(&self) -> u64
pub fn npages(&self) -> u64
Number of pages in the (paged) data block.
npages = ceil(num_elmts / dblk_page_nelmts) — encoded in C as
((nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts.
Returns 0 when the data block is not paged.
Sourcepub fn encoded_size(&self, ctx: &FormatContext) -> usize
pub fn encoded_size(&self, ctx: &FormatContext) -> usize
Compute the encoded size (for pre-allocation).
pub fn encode(&self, ctx: &FormatContext) -> Vec<u8> ⓘ
pub fn decode(buf: &[u8], ctx: &FormatContext) -> FormatResult<Self>
Trait Implementations§
Source§impl Clone for FixedArrayHeader
impl Clone for FixedArrayHeader
Source§fn clone(&self) -> FixedArrayHeader
fn clone(&self) -> FixedArrayHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FixedArrayHeader
impl Debug for FixedArrayHeader
Source§impl PartialEq for FixedArrayHeader
impl PartialEq for FixedArrayHeader
Source§fn eq(&self, other: &FixedArrayHeader) -> bool
fn eq(&self, other: &FixedArrayHeader) -> bool
self and other values to be equal, and is used by ==.