pub(crate) trait Shape<K: Key> {
const NUM_BUCKETS: usize;
// Required method
fn item_range(&self, bucket: usize) -> Range<usize>;
// Provided methods
fn divisor(&self) -> K { ... }
fn split_wide_key(&self, key: K) -> (usize, K) { ... }
fn join_wide_key(&self, bucket: usize, remainder: K) -> K { ... }
}Expand description
Trait for accessing the overall shape of a bucket array
Required Associated Constants§
Sourceconst NUM_BUCKETS: usize
const NUM_BUCKETS: usize
The number of buckets in this array
Required Methods§
Sourcefn item_range(&self, bucket: usize) -> Range<usize>
fn item_range(&self, bucket: usize) -> Range<usize>
Get the range of items within a single bucket.
Provided Methods§
Sourcefn split_wide_key(&self, key: K) -> (usize, K)
fn split_wide_key(&self, key: K) -> (usize, K)
Split a wide key into the bucket index and the remaining bits.
Sourcefn join_wide_key(&self, bucket: usize, remainder: K) -> K
fn join_wide_key(&self, bucket: usize, remainder: K) -> K
Rebuild a wide key from its split components.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".