Struct solana_bucket_map::index_entry::MultipleSlots
source · #[repr(C)]pub(crate) struct MultipleSlots {
storage_cap_and_offset: PackedStorage,
num_slots: Slot,
}
Expand description
required fields when an index element references the data file
Fields§
§storage_cap_and_offset: PackedStorage
§num_slots: Slot
num elements in the slot list
Implementations§
source§impl MultipleSlots
impl MultipleSlots
pub(crate) fn set_storage_capacity_when_created_pow2( &mut self, storage_capacity_when_created_pow2: u8 )
pub(crate) fn set_storage_offset(&mut self, storage_offset: u64)
fn storage_capacity_when_created_pow2(&self) -> u8
fn storage_offset(&self) -> u64
pub(crate) fn num_slots(&self) -> Slot
pub(crate) fn set_num_slots(&mut self, num_slots: Slot)
pub(crate) fn data_bucket_ix(&self) -> u64
sourcepub(crate) fn data_bucket_from_num_slots(num_slots: Slot) -> u64
pub(crate) fn data_bucket_from_num_slots(num_slots: Slot) -> u64
return closest bucket index fit for the slot slice. Since bucket size is 2^index, the return value is min index, such that 2^index >= num_slots index = ceiling(log2(num_slots)) special case, when slot slice empty, return 0th index.
sourcepub(crate) fn data_loc(&self, storage: &BucketStorage<BucketWithHeader>) -> u64
pub(crate) fn data_loc(&self, storage: &BucketStorage<BucketWithHeader>) -> u64
This function maps the original data location into an index in the current bucket storage. This is coupled with how we resize bucket storages.
sourcepub fn set_ref_count(
data_bucket: &mut BucketStorage<BucketWithHeader>,
data_ix: u64,
ref_count: RefCount
)
pub fn set_ref_count( data_bucket: &mut BucketStorage<BucketWithHeader>, data_ix: u64, ref_count: RefCount )
ref_count is stored in the header per cell, in packed_ref_count
sourcepub fn ref_count(
data_bucket: &BucketStorage<BucketWithHeader>,
data_ix: u64
) -> RefCount
pub fn ref_count( data_bucket: &BucketStorage<BucketWithHeader>, data_ix: u64 ) -> RefCount
ref_count is stored in the header per cell, in packed_ref_count
Trait Implementations§
source§impl Clone for MultipleSlots
impl Clone for MultipleSlots
source§fn clone(&self) -> MultipleSlots
fn clone(&self) -> MultipleSlots
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MultipleSlots
impl Debug for MultipleSlots
source§impl Default for MultipleSlots
impl Default for MultipleSlots
source§fn default() -> MultipleSlots
fn default() -> MultipleSlots
Returns the “default value” for a type. Read more
source§impl PartialEq<MultipleSlots> for MultipleSlots
impl PartialEq<MultipleSlots> for MultipleSlots
source§fn eq(&self, other: &MultipleSlots) -> bool
fn eq(&self, other: &MultipleSlots) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for MultipleSlots
impl Eq for MultipleSlots
impl StructuralEq for MultipleSlots
impl StructuralPartialEq for MultipleSlots
Auto Trait Implementations§
impl RefUnwindSafe for MultipleSlots
impl Send for MultipleSlots
impl Sync for MultipleSlots
impl Unpin for MultipleSlots
impl UnwindSafe for MultipleSlots
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more