pub struct SymbolTableNode {
pub entries: Vec<SymbolTableEntry>,
}Expand description
A decoded symbol table node.
Fields§
§entries: Vec<SymbolTableEntry>The symbol table entries in this node.
Implementations§
Source§impl SymbolTableNode
impl SymbolTableNode
Sourcepub fn encode(
&self,
node_size: usize,
sizeof_addr: usize,
sizeof_size: usize,
) -> FormatResult<Vec<u8>>
pub fn encode( &self, node_size: usize, sizeof_addr: usize, sizeof_size: usize, ) -> FormatResult<Vec<u8>>
Encode this node into a block of exactly node_size bytes.
A SNOD is a fixed-size record — H5G_NODE_SIZE(f), which
BTreeV1Config::symbol_table_node_size computes — whatever fraction
of it the entries fill, because the B-tree above it allocates every
leaf the same width. The unused tail is zeroed rather than left as it
was: H5G__node_create calloc’s the entry array, so a node libhdf5
wrote never carries a stale entry past num_symbols.
Sourcepub fn decode(
buf: &[u8],
sizeof_addr: usize,
sizeof_size: usize,
max_entries: u16,
) -> FormatResult<Self>
pub fn decode( buf: &[u8], sizeof_addr: usize, sizeof_size: usize, max_entries: u16, ) -> FormatResult<Self>
Decode a symbol table node from buf.
sizeof_addr and sizeof_size come from the superblock, and
max_entries is 2 * sym_leaf_k — the node’s fixed capacity
(H5Gpkg.h H5G_NODE_SIZE). A node declaring more than that is
corrupt, not merely unusual, so it is rejected before its entries are
read.