Struct splay::map::SplayMap [] [src]

pub struct SplayMap<K: Ord, V> { /* fields omitted */ }

The implementation of this splay tree is largely based on the c code at: ftp://ftp.cs.cmu.edu/usr/ftp/usr/sleator/splaying/top-down-splay.c This version of splaying is a top-down splay operation.

Methods

impl<K: Ord, V> SplayMap<K, V>
[src]

Moves all values out of this map, transferring ownership to the given iterator.

Clears the tree in O(1) extra space (including the stack). This is necessary to prevent stack exhaustion with extremely large trees.

Return true if the map contains a value for the specified key

Return a reference to the value corresponding to the key

Return a mutable reference to the value corresponding to the key

Insert a key-value pair from the map. If the key already had a value present in the map, that value is returned. Otherwise None is returned.

Removes a key from the map, returning the value at the key if the key was previously in the map.

Trait Implementations

impl<'a, K: Ord, V, Q: ?Sized> Index<&'a Q> for SplayMap<K, V> where
    K: Borrow<Q>,
    Q: Ord
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<'a, K: Ord, V, Q: ?Sized> IndexMut<&'a Q> for SplayMap<K, V> where
    K: Borrow<Q>,
    Q: Ord
[src]

The method for the mutable indexing (container[index]) operation

impl<K: Ord, V> Default for SplayMap<K, V>
[src]

Returns the "default value" for a type. Read more

impl<K: Ord, V> FromIterator<(K, V)> for SplayMap<K, V>
[src]

Creates a value from an iterator. Read more

impl<K: Ord, V> Extend<(K, V)> for SplayMap<K, V>
[src]

Extends a collection with the contents of an iterator. Read more

impl<K: Clone + Ord, V: Clone> Clone for SplayMap<K, V>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<K: Ord, V> Drop for SplayMap<K, V>
[src]

A method called when the value goes out of scope. Read more