pub trait Collection:
Send
+ Sync
+ 'static {
type Handle: CollectionHandle;
// Required methods
fn with_capacity(capacity: usize) -> Self;
fn pin(&self) -> Self::Handle;
}Expand description
A collection that can be benchmarked by bustle.
Any thread that performs operations on the collection will first call pin and then perform
collection operations on the Handle that is returned. pin will not be called in the hot
loop of the benchmark.
Required Associated Types§
Sourcetype Handle: CollectionHandle
type Handle: CollectionHandle
A thread-local handle to the concurrent collection under test.
Required Methods§
Sourcefn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Allocate a new instance of the benchmark target with the given capacity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.