[−][src]Struct avl::AvlTreeMap
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]
K: Debug,
V: Debug,
impl<K: Ord, V> Default for Map<K, V>
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<K, V> IntoIterator for Map<K, V>
[src]
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Map<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
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,
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,