#[repr(C, align(8))]pub struct InnerNodeCompressed<K, V, const PREFIX_LEN: usize, const SIZE: usize> {
pub header: Header<PREFIX_LEN>,
pub keys: [MaybeUninit<u8>; SIZE],
pub child_pointers: [MaybeUninit<OpaqueNodePtr<K, V, PREFIX_LEN>>; SIZE],
}
Expand description
Node type that has a compact representation for key bytes and children pointers.
Fields§
§header: Header<PREFIX_LEN>
The common node fields.
keys: [MaybeUninit<u8>; SIZE]
An array that contains single key bytes in the same index as the
child_pointers
array contains the matching child tree.
This array will only be initialized for the first header.num_children
values.
child_pointers: [MaybeUninit<OpaqueNodePtr<K, V, PREFIX_LEN>>; SIZE]
An array that contains the child data.
This array will only be initialized for the first header.num_children
values.
Implementations§
Source§impl<K, V, const PREFIX_LEN: usize, const SIZE: usize> InnerNodeCompressed<K, V, PREFIX_LEN, SIZE>
impl<K, V, const PREFIX_LEN: usize, const SIZE: usize> InnerNodeCompressed<K, V, PREFIX_LEN, SIZE>
Sourcepub fn initialized_portion(&self) -> (&[u8], &[OpaqueNodePtr<K, V, PREFIX_LEN>])
pub fn initialized_portion(&self) -> (&[u8], &[OpaqueNodePtr<K, V, PREFIX_LEN>])
Return the initialized portions of the keys and child pointer arrays.
Sourcefn lookup_child_inner(
&self,
key_fragment: u8,
) -> Option<OpaqueNodePtr<K, V, PREFIX_LEN>>where
Self: SearchInnerNodeCompressed,
fn lookup_child_inner(
&self,
key_fragment: u8,
) -> Option<OpaqueNodePtr<K, V, PREFIX_LEN>>where
Self: SearchInnerNodeCompressed,
Generalized version of InnerNode::lookup_child
for compressed nodes
Sourcefn write_child_inner(
&mut self,
key_fragment: u8,
child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>,
)where
Self: SearchInnerNodeCompressed,
fn write_child_inner(
&mut self,
key_fragment: u8,
child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>,
)where
Self: SearchInnerNodeCompressed,
Writes a child to the node by check the order of insertion
§Panics
- This functions assumes that the write is gonna be inbound (i.e the check for a full node is done previously to the call of this function)
Sourcepub unsafe fn write_child_unchecked(
&mut self,
key_fragment: u8,
child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>,
)
pub unsafe fn write_child_unchecked( &mut self, key_fragment: u8, child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>, )
Writes a child to the node without bounds check or order
§Safety
- This functions assumes that the write is gonna be inbound (i.e the check for a full node is done previously to the call of this function)
Sourceunsafe fn write_child_at(
&mut self,
idx: usize,
key_fragment: u8,
child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>,
)
unsafe fn write_child_at( &mut self, idx: usize, key_fragment: u8, child_pointer: OpaqueNodePtr<K, V, PREFIX_LEN>, )
Writes a child to the node without bounds check or order
§Safety
- This functions assumes that the write is gonna be inbound (i.e the check for a full node is done previously to the call of this function)
Sourcefn remove_child_inner(
&mut self,
key_fragment: u8,
) -> Option<OpaqueNodePtr<K, V, PREFIX_LEN>>where
Self: SearchInnerNodeCompressed,
fn remove_child_inner(
&mut self,
key_fragment: u8,
) -> Option<OpaqueNodePtr<K, V, PREFIX_LEN>>where
Self: SearchInnerNodeCompressed,
Removes child if it exists
Sourcefn change_block_size<const NEW_SIZE: usize>(
&self,
) -> InnerNodeCompressed<K, V, PREFIX_LEN, NEW_SIZE>
fn change_block_size<const NEW_SIZE: usize>( &self, ) -> InnerNodeCompressed<K, V, PREFIX_LEN, NEW_SIZE>
Grows or shrinks the node
Sourcefn grow_node48(&self) -> InnerNode48<K, V, PREFIX_LEN>
fn grow_node48(&self) -> InnerNode48<K, V, PREFIX_LEN>
Transform node into a InnerNode48
Sourcefn inner_iter(&self) -> InnerNodeCompressedIter<'_, K, V, PREFIX_LEN>
fn inner_iter(&self) -> InnerNodeCompressedIter<'_, K, V, PREFIX_LEN>
Get an iterator over the keys and values of the node
Sourcefn inner_range_iter(
&self,
bound: impl RangeBounds<u8>,
) -> InnerNodeCompressedIter<'_, K, V, PREFIX_LEN>where
Self: SearchInnerNodeCompressed,
fn inner_range_iter(
&self,
bound: impl RangeBounds<u8>,
) -> InnerNodeCompressedIter<'_, K, V, PREFIX_LEN>where
Self: SearchInnerNodeCompressed,
Get an iterator over a range of keys and values of the node.