[][src]Trait bustle::CollectionHandle

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; }

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.

Associated Types

type Key: From<u64>

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

Loading content...

Required methods

fn get(&mut self, key: &Self::Key) -> bool

Perform a lookup for key.

Should return true if the key is found.

fn insert(&mut self, key: &Self::Key) -> bool

Insert key into the collection.

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

fn remove(&mut self, key: &Self::Key) -> bool

Remove key from the collection.

Should return true if the key existed and was removed.

fn update(&mut self, key: &Self::Key) -> bool

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.

Loading content...

Implementors

Loading content...