Skip to main content

peek_node_kind

Function peek_node_kind 

Source
pub fn peek_node_kind(buf: &[u8; 4096]) -> Result<NodeKind>
Expand description

Read only the node-kind tag from a B+tree page header.

O(1), allocation-free. Used by the snapshot read path to decide whether to descend (full decode_node for an internal node, so choose_child has the pivots) or to copy out a single value via decode_node_find (a leaf). A malformed page-type tag surfaces as Error::Corruption identically to decode_node.

ยงErrors

Error::Corruption if the page-type tag is neither leaf nor internal.