Struct toolshed::map::BloomMap [] [src]

pub struct BloomMap<'arena, K: 'arena, V: 'arena + Copy> { /* fields omitted */ }

A variant of the Map that includes a bloom filter using the bloom function for keys that can be represented as byte slices.

This is ideal for small maps for which querying for absent keys is a common behavior. In this case it will very likely outperform a HashMap, even one with a fast hashing algorithm.

Methods

impl<'arena, K, V> BloomMap<'arena, K, V> where
    K: Eq + Hash + Copy + AsRef<[u8]>,
    V: Copy
[src]

[src]

Create a new, empty BloomMap.

[src]

Inserts a key-value pair into the map.

[src]

Returns the value corresponding to the key.

[src]

Returns true if the map contains a value for the specified key.

[src]

Returns true if the map contains no elements.

[src]

Clears the map.