Trait bustle::CollectionHandle
source · 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§
Required Methods§
sourcefn get(&mut self, key: &Self::Key) -> bool
fn get(&mut self, key: &Self::Key) -> bool
Perform a lookup for key
.
Should return true
if the key is found.
sourcefn insert(&mut self, key: &Self::Key) -> bool
fn insert(&mut self, key: &Self::Key) -> bool
Insert key
into the collection.
Should return true
if no value previously existed for the key.