Struct accumulator::Accumulator [] [src]

pub struct Accumulator<Key, Value> where
    Key: PartialOrd + Ord + Clone,
    Value: Clone
{ /* fields omitted */ }

A key-value store limited by size or time, allowing accumulation of multiple values under a single key.

Methods

impl<Key: PartialOrd + Ord + Clone, Value: Clone + Eq + Hash> Accumulator<Key, Value>
[src]

Constructor for capacity based Accumulator.

quorum defines the count at and above which add() will return Some().

Constructor for time based Accumulator.

quorum defines the count at and above which add() will return Some().

Returns whether key exists in the accumulator or not.

Returns whether key exists and has accumulated quorum or more corresponding values.

Adds a key-value pair.

Returns the corresponding values for key if quorum or more values have been accumulated, otherwise returns None.

Returns the values accumulated under key, or None if key doesn't exist.

Removes key and all corresponding accumulated values.

Returns the size of the accumulator, i.e. the number of keys held.

Sets a new value for quorum.

This has immediate effect, even for existing key-value entries.

Returns the current value for quorum.