pub(crate) struct ValueBucketArray<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy>(BucketArray<'v, N, CAP, C, V>, PhantomData<K>);
Expand description
Concrete bucket array with a single BucketArrayMemory
for value storage
Keys are used for bucket indexing but the remainder bits are not stored.
Tuple Fields§
§0: BucketArray<'v, N, CAP, C, V>
§1: PhantomData<K>
Implementations§
Source§impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> ValueBucketArray<'v, N, CAP, C, K, V>
Sourcepub(crate) fn new(value_mem: &'v mut BucketArrayMemory<N, CAP, V>) -> Self
pub(crate) fn new(value_mem: &'v mut BucketArrayMemory<N, CAP, V>) -> Self
A new ValueBucketArray
wraps one mutable BucketArrayMemory
reference and adds a counts array to track which items are valid.
Trait Implementations§
Source§impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> Insert<K, V> for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> Insert<K, V> for ValueBucketArray<'v, N, CAP, C, K, V>
Source§impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> Shape<K> for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> Shape<K> for ValueBucketArray<'v, N, CAP, C, K, V>
Source§const NUM_BUCKETS: usize = N
const NUM_BUCKETS: usize = N
Number of buckets in the array
Source§fn item_range(&self, bucket: usize) -> Range<usize>
fn item_range(&self, bucket: usize) -> Range<usize>
Get the range of items within a single bucket.
Source§fn 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.
Source§fn 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.
Source§impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> ValueLookup<V> for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C: Count, K: Key, V: Copy> ValueLookup<V> for ValueBucketArray<'v, N, CAP, C, K, V>
Source§fn item_value(&self, bucket: usize, item: usize) -> V
fn item_value(&self, bucket: usize, item: usize) -> V
Retrieve the Value for a particular item
Auto Trait Implementations§
impl<'v, const N: usize, const CAP: usize, C, K, V> Freeze for ValueBucketArray<'v, N, CAP, C, K, V>where
C: Freeze,
impl<'v, const N: usize, const CAP: usize, C, K, V> RefUnwindSafe for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C, K, V> Send for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C, K, V> Sync for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C, K, V> Unpin for ValueBucketArray<'v, N, CAP, C, K, V>
impl<'v, const N: usize, const CAP: usize, C, K, V> !UnwindSafe for ValueBucketArray<'v, N, CAP, C, K, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more