Struct collections::btree::node::Root
[−]
[src]
pub struct Root<K, V> { node: BoxedNode<K, V>, height: usize, }
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
An owned tree. Note that despite being owned, this does not have a destructor, and must be cleaned up manually.
Fields
node | Unstable ( collections #27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead |
height | Unstable ( collections #27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead |
Methods
impl<K, V> Root<K, V>
fn new_leaf() -> Self
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
fn as_ref(&self) -> NodeRef<Immut, K, V, LeafOrInternal>
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
fn as_mut(&mut self) -> NodeRef<Mut, K, V, LeafOrInternal>
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
fn into_ref(self) -> NodeRef<Owned, K, V, LeafOrInternal>
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
fn push_level(&mut self) -> NodeRef<Mut, K, V, Internal>
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
Add a new internal node with a single edge, pointing to the previous root, and make that
new node the root. This increases the height by 1 and is the opposite of pop_level
.
fn pop_level(&mut self)
collections
#27783): library is unlikely to be stabilized with the current layout and name, use std::collections instead
Remove the root node, using its first child as the new root. This cannot be called when
the tree consists only of a leaf node. As it is intended only to be called when the root
has only one edge, no cleanup is done on any of the other children are elements of the root.
This decreases the height by 1 and is the opposite of push_level
.