Struct accumulator::Accumulator
[−]
[src]
pub struct Accumulator<K, V> where K: PartialOrd + Ord + Clone, V: Clone {
// some fields omitted
}
Accumulator for various message types
Methods
impl<K: PartialOrd + Ord + Clone, V: Clone> Accumulator<K, V>
[src]
fn new(quorum: usize) -> Accumulator<K, V>
Construct an accumulator and pass size to accumulate unil
fn have_name(&mut self, name: &K) -> bool
Check for existence of any key and refresh
the key in the LRU cache.
fn contains_key(&self, name: &K) -> bool
Check for existence of any key
fn is_quorum_reached(&mut self, name: &K) -> bool
Check if requested size is accumulated
fn add(&mut self, name: K, value: V) -> Option<(K, Vec<V>)>
Add a key / value pair, returns key and vector of values if size reached
fn get(&mut self, name: &K) -> Option<(K, Vec<V>)>
Retrieve a ky/value from the store
fn delete(&mut self, name: &K)
Remove an entry (all values for a key will be removed)
fn cache_size(&mut self) -> usize
Return size of container