Struct collections::btree::node::Root [] [src]

pub struct Root<K, V> {
    node: BoxedNode<K, V>,
    height: usize,
}
Unstable (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

Unstable (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>

Unstable (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>

Unstable (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>

Unstable (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>

Unstable (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)

Unstable (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.

Trait Implementations

impl<K: Sync, V: Sync> Sync for Root<K, V>

impl<K: Send, V: Send> Send for Root<K, V>