Struct timely::progress::count_map::CountMap
[−]
[src]
pub struct CountMap<T> { /* fields omitted */ }Represents a map from T to i64 with values mapping to zero removed.
The implementation is currently a Vec<(T, i64)> as the use cases are currently for small
buffers of updates rather than large storage. This could change as needs evolve.
Methods
impl<T: Eq + Clone> CountMap<T>[src]
fn update(&mut self, key: &T, val: i64) -> i64
Adds val to the value associated with key, returning the new value.
fn into_inner(self) -> Vec<(T, i64)>
Extracts the Vec<(T, i64)> from the map, consuming it.
fn iter(&self) -> Iter<(T, i64)>
Iterates over the contents of the map.
fn clear(&mut self)
Clears the map.
fn len(&self) -> usize
The number of non-zero keys in the map.
fn is_empty(&self) -> bool
True iff all keys have value zero.
fn pop(&mut self) -> Option<(T, i64)>
Returns an element of the map, or None if it is empty.
fn new() -> CountMap<T>
Allocates a new empty CountMap.
fn new_from(key: &T, val: i64) -> CountMap<T>
Allocates a new CountMap with a single entry.
fn drain_into(&mut self, other: &mut CountMap<T>)
Drains self into other.
fn extend<I: Iterator<Item = (T, i64)>>(&mut self, iterator: I)
Performs a sequence of updates described by iterator.
Trait Implementations
impl<T: Clone> Clone for CountMap<T>[src]
fn clone(&self) -> CountMap<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more