[][src]Struct avl::AvlTreeMap

pub struct AvlTreeMap<K, V> { /* fields omitted */ }

A sorted map implemented with a nearly balanced binary search tree.

Implementations

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

pub fn new() -> Self[src]

Creates an empty map. No memory is allocated until the first item is inserted.

pub fn get(&self, key: &K) -> Option<&V>[src]

Returns a reference to the value corresponding to the key.

pub fn get_mut(&mut self, key: &K) -> Option<&mut V>[src]

Returns a mutable reference to the value corresponding to the key.

pub fn get_key_value(&self, key: &K) -> Option<(&K, &V)>[src]

Returns references to the key-value pair corresponding to the key.

pub fn insert(&mut self, key: K, value: V) -> bool[src]

Inserts a key-value pair into the map.

pub fn remove(&mut self, key: &K) -> Option<V>[src]

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

pub fn remove_entry(&mut self, key: &K) -> Option<(K, V)>[src]

Removes a key from the map. Returns the stored key and value if the key was previously in the map.

impl<K, V> Map<K, V>[src]

pub fn is_empty(&self) -> bool[src]

Returns true if the map contains no elements.

pub fn len(&self) -> usize[src]

Returns the number of elements in the map.

pub fn clear(&mut self)[src]

Clears the map, deallocating all memory.

impl<K, V> Map<K, V>[src]

pub fn iter<'a>(&'a self) -> Iter<'a, K, V>[src]

Gets an iterator over the entries of the map, sorted by key.

pub fn keys<'a>(&'a self) -> Keys<'a, K, V>[src]

Gets an iterator over the keys of the map, in sorted order.

pub fn values<'a>(&'a self) -> Values<'a, K, V>[src]

Gets an iterator over the values of the map, in order by key.

pub fn values_mut<'a>(&'a self) -> ValuesMut<'a, K, V>[src]

Gets a mutable iterator over the values of the map, in order by key.

pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, K, V>[src]

Gets a mutable iterator over the entries of the map, sorted by key.

Trait Implementations

impl<K, V> Debug for Map<K, V> where
    K: Debug,
    V: Debug
[src]

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

fn default() -> Self[src]

Creates an empty map.

impl<K, V> Drop for Map<K, V>[src]

impl<'a, K, V> IntoIterator for &'a Map<K, V>[src]

type Item = (&'a K, &'a V)

The type of the elements being iterated over.

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?

impl<'a, K, V> IntoIterator for &'a mut Map<K, V>[src]

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?

impl<K, V> IntoIterator for Map<K, V>[src]

type Item = (K, V)

The type of the elements being iterated over.

type IntoIter = IntoIter<K, V>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Map<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> !Send for Map<K, V>

impl<K, V> !Sync for Map<K, V>

impl<K, V> Unpin for Map<K, V>

impl<K, V> UnwindSafe for Map<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.