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]

[src]

Constructor for capacity based Accumulator.

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

[src]

Constructor for time based Accumulator.

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

[src]

Returns whether key exists in the accumulator or not.

[src]

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

[src]

Adds a key-value pair.

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

[src]

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

[src]

Removes key and all corresponding accumulated values.

[src]

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

[src]

Sets a new value for quorum.

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

[src]

Returns the current value for quorum.