pub trait CollectionHandle {
    type Key: From<u64>;

    fn get(&mut self, key: &Self::Key) -> bool;
    fn insert(&mut self, key: &Self::Key) -> bool;
    fn remove(&mut self, key: &Self::Key) -> bool;
    fn update(&mut self, key: &Self::Key) -> bool;
}
Expand description

A handle to a key-value collection.

Note that for all these methods, the benchmarker does not dictate what the values are. Feel free to use the same value for all operations, or use distinct ones and check that your retrievals indeed return the right results.

Required Associated Types

The u64 seeds used to construct Key (through From<u64>) are distinct. The returned keys must be as well.

Required Methods

Perform a lookup for key.

Should return true if the key is found.

Insert key into the collection.

Should return true if no value previously existed for the key.

Remove key from the collection.

Should return true if the key existed and was removed.

Update the value for key in the collection, if it exists.

Should return true if the key existed and was updated.

Should not insert the key if it did not exist.

Implementors