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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedArrayHeader
impl Debug for FixedArrayHeader
Source§impl PartialEq for FixedArrayHeader
impl PartialEq for FixedArrayHeader
impl StructuralPartialEq for FixedArrayHeader
Auto Trait Implementations§
impl Freeze for FixedArrayHeader
impl RefUnwindSafe for FixedArrayHeader
impl Send for FixedArrayHeader
impl Sync for FixedArrayHeader
impl Unpin for FixedArrayHeader
impl UnsafeUnpin for FixedArrayHeader
impl UnwindSafe for FixedArrayHeader
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
Mutably borrows from an owned value. Read more