[src]

Struct collections::btree::BTree

pub struct BTree<K, V> {
    // some fields omitted
}

Methods

impl<K: TotalOrd, V> BTree<K, V>

fn new(k: K, v: V, lb: uint) -> BTree<K, V>

Returns new BTree with root node (leaf) and user-supplied lower bound The lower bound applies to every node except the root node.

impl<K: Clone + TotalOrd, V: Clone> BTree<K, V>

fn get(self, k: K) -> Option<V>

Returns the value of a given key, which may not exist in the tree. Calls the root node's get method.

fn insert(self, k: K, v: V) -> BTree<K, V>

An insert method that uses the clone() feature for support.

Trait Implementations

impl<K: Clone + TotalOrd, V: Clone> Clone for BTree<K, V>

fn clone(&self) -> BTree<K, V>

Implements the Clone trait for the BTree. Uses a helper function/constructor to produce a new BTree.

impl<K: TotalOrd, V: TotalEq> Eq for BTree<K, V>

fn eq(&self, other: &BTree<K, V>) -> bool

impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V>

impl<K: TotalOrd, V: TotalEq> Ord for BTree<K, V>

fn lt(&self, other: &BTree<K, V>) -> bool

impl<K: TotalOrd, V: TotalEq> TotalOrd for BTree<K, V>

fn cmp(&self, other: &BTree<K, V>) -> Ordering

Returns an ordering based on the root nodes of each BTree.

impl<K: Show + TotalOrd, V: Show> Show for BTree<K, V>

fn fmt(&self, f: &mut Formatter) -> Result

Returns a string representation of the BTree