pub struct TreeMap<K, V> { /* private fields */ }Expand description
See the module-level documentation for more details.
Implementations§
Source§impl<K, V> TreeMap<K, V>
impl<K, V> TreeMap<K, V>
Sourcepub fn contains(&self, key: K) -> bool
pub fn contains(&self, key: K) -> bool
Returns true if the map contains an entry associated with the given key.
Sourcepub fn put(&mut self, key: K, value: V) -> Option<Entry<K, V>>
pub fn put(&mut self, key: K, value: V) -> Option<Entry<K, V>>
Inserts the entry into the map. If the key already exists, removes
and returns the old entry and inserts a new one. This allows for
situations where keys are == without being identical.
Sourcepub fn mut_val_or()
pub fn mut_val_or()
Mutates
Sourcepub fn remove(&mut self, key: K) -> Option<Entry<K, V>>
pub fn remove(&mut self, key: K) -> Option<Entry<K, V>>
Removes and returns the entry associated with the key:value pair, if it exists in the map.
Sourcepub fn iter(&self) -> Iter<'_, K, V> ⓘ
pub fn iter(&self) -> Iter<'_, K, V> ⓘ
Returns an iterator over borrowed values. The resulting values appear in sorted order.
Example use:
use dsa_rust::associative::probing_hash_table::HashMap;
let mut count: HashMap<char, u8> = HashMap::new();
let mut v = Vec::new();
for e in count.iter() {
v.push(*e.0);
}Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for TreeMap<K, V>
impl<K, V> RefUnwindSafe for TreeMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for TreeMap<K, V>
impl<K, V> Sync for TreeMap<K, V>
impl<K, V> Unpin for TreeMap<K, V>
impl<K, V> UnwindSafe for TreeMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more