pub struct IndexBucketUsingBitVecBits<T: 'static> {
pub enum_tag: BitVec,
capacity: u64,
_phantom: PhantomData<&'static T>,
}
Expand description
allocated in contents
in a BucketStorage
Fields§
§enum_tag: BitVec
2 bits per entry that represent a 4 state enum tag
capacity: u64
number of elements allocated
_phantom: PhantomData<&'static T>
Implementations§
source§impl<T: Copy + 'static> IndexBucketUsingBitVecBits<T>
impl<T: Copy + 'static> IndexBucketUsingBitVecBits<T>
sourcefn set_bits(&mut self, ix: u64, first: bool, second: bool)
fn set_bits(&mut self, ix: u64, first: bool, second: bool)
set the 2 bits (first and second) in enum_tag
sourcefn set_enum_tag(&mut self, ix: u64, value: OccupiedEnumTag)
fn set_enum_tag(&mut self, ix: u64, value: OccupiedEnumTag)
turn the tag into bits and store them
sourcefn get_enum_tag(&self, ix: u64) -> OccupiedEnumTag
fn get_enum_tag(&self, ix: u64) -> OccupiedEnumTag
read the bits and convert them to an enum tag
Trait Implementations§
source§impl<T> BucketCapacity for IndexBucketUsingBitVecBits<T>
impl<T> BucketCapacity for IndexBucketUsingBitVecBits<T>
source§impl<T: Copy + 'static> BucketOccupied for IndexBucketUsingBitVecBits<T>
impl<T: Copy + 'static> BucketOccupied for IndexBucketUsingBitVecBits<T>
source§fn copying_entry(
&mut self,
_element_new: &mut [u8],
ix_new: usize,
other: &Self,
_element_old: &[u8],
ix_old: usize
)
fn copying_entry( &mut self, _element_new: &mut [u8], ix_new: usize, other: &Self, _element_old: &[u8], ix_old: usize )
in this impl, the enum tag is stored in in-memory bit vec and there is more information than a single ‘occupied’ bit. So, this enum_tag needs to be copied over.
source§fn occupy(&mut self, element: &mut [u8], ix: usize)
fn occupy(&mut self, element: &mut [u8], ix: usize)
set entry at
ix
as occupied (as opposed to free)source§fn offset_to_first_data() -> usize
fn offset_to_first_data() -> usize
of bytes prior to first data held in the element. Read more
Auto Trait Implementations§
impl<T> RefUnwindSafe for IndexBucketUsingBitVecBits<T>where T: RefUnwindSafe,
impl<T> Send for IndexBucketUsingBitVecBits<T>where T: Sync,
impl<T> Sync for IndexBucketUsingBitVecBits<T>where T: Sync,
impl<T> Unpin for IndexBucketUsingBitVecBits<T>
impl<T> UnwindSafe for IndexBucketUsingBitVecBits<T>where T: RefUnwindSafe,
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