pub struct BlockHeader {
pub num_records: u32,
pub metadata_compression: u8,
pub bitmap_type: u16,
pub placeholder1: u8,
pub block_len: u32,
pub flags_len: u64,
pub fields_present: u16,
pub placeholder2: u16,
pub placeholder3: u64,
}Expand description
Block header for encoded data
Always the first 32 bytes at the beginning of a .ahda block.
Must always conform to this format.
The BlockHeader contains the following data:
- Number of records stored in this block.
- The metadata compression method used for BlockFlags.
- Type of bitmap stored in this block.
- A 1 byte unused placeholder value.
- The number of bytes in the block contents that follow the BlockFlags bytes.
- Number of bytes containing the BlockFlags that follow the header.
- Fields that are present in the BlockFlags.
- A 2 byte unused placeholder value.
- A 8 byte unused placeholder value.
Fields§
§num_records: u32Number of records (queries) stored in this block
metadata_compression: u8Compression method used for BlockFlags, see MetadataCompression.
bitmap_type: u16Bitmap type used to encode this block, see BitmapType for details.
The address space of the block bitmap type must fit within the file bitmap type specified in crate::headers::file::FileHeader. Given that this is satisfied, the block bitmap type may differ from the file bitmap type.
placeholder1: u8Placeholder:
block_len: u32Number of bytes in the block contents that follow the flags bytes.
flags_len: u64Number of bytes in BlockFlags that follow the header bytes.
fields_present: u16BlockFlags fields that are present for records in this block.
Every block must contain at least the fields given in the crate::headers::file::FileHeader
fields_present. A block may also contain extra fields that are not
specified in crate::headers::file::FileHeader.
placeholder2: u16Placeholder
placeholder3: u64Placeholder
Implementations§
Source§impl BlockHeader
impl BlockHeader
Sourcepub fn promises_query_names(&self) -> bool
pub fn promises_query_names(&self) -> bool
Does the header require the encoded data to contain the query names?
Sourcepub fn promises_query_ids(&self) -> bool
pub fn promises_query_ids(&self) -> bool
Does the header require the encoded data to contain the query indexes?
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockHeader
impl<'__de, __Context> BorrowDecode<'__de, __Context> for BlockHeader
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
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 BlockHeader
impl Debug for BlockHeader
Source§impl<__Context> Decode<__Context> for BlockHeader
impl<__Context> Decode<__Context> for BlockHeader
Source§impl Default for BlockHeader
impl Default for BlockHeader
Source§fn default() -> BlockHeader
fn default() -> BlockHeader
Initialize a header with default values.
Note: This header is not a valid ahda header for most cases. Update the fields accordingly before using.
If you need to encode individual ahda blocks, prefer using pack_records.