Struct alloc::collections::btree::node::InternalNode
source · #[repr(C)]struct InternalNode<K, V> {
data: LeafNode<K, V>,
edges: [MaybeUninit<NonNull<LeafNode<K, V>>>; 12],
}
Expand description
The underlying representation of internal nodes. As with LeafNode
s, these should be hidden
behind BoxedNode
s to prevent dropping uninitialized keys and values. Any pointer to an
InternalNode
can be directly cast to a pointer to the underlying LeafNode
portion of the
node, allowing code to act on leaf and internal nodes generically without having to even check
which of the two a pointer is pointing at. This property is enabled by the use of repr(C)
.
Fields§
§data: LeafNode<K, V>
§edges: [MaybeUninit<NonNull<LeafNode<K, V>>>; 12]
The pointers to the children of this node. len + 1
of these are considered
initialized and valid, except that near the end, while the tree is held
through borrow type Dying
, some of these pointers are dangling.
Implementations§
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for InternalNode<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,
impl<K, V> !Send for InternalNode<K, V>
impl<K, V> !Sync for InternalNode<K, V>
impl<K, V> Unpin for InternalNode<K, V>where K: Unpin, V: Unpin,
impl<K, V> UnwindSafe for InternalNode<K, V>where K: UnwindSafe + RefUnwindSafe, V: UnwindSafe + RefUnwindSafe,
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