pub struct DHarhtMemory<V: Clone> { /* private fields */ }Expand description
D-HARHT Memory profile — port of the user-supplied blueprint.
Implementations§
Source§impl<V: Clone> DHarhtMemory<V>
impl<V: Clone> DHarhtMemory<V>
pub fn new() -> Self
pub fn is_sealed(&self) -> bool
pub fn len(&self) -> u64
pub fn is_empty(&self) -> bool
pub fn micro_overflow_count(&self) -> u64
pub fn max_collision_group(&self) -> u32
Sourcepub fn approx_memory_bytes(&self) -> usize
pub fn approx_memory_bytes(&self) -> usize
Approximate allocated memory in bytes. Counts shard slabs, front-directory pages, micro-bucket pools, and BTreeMap fallback. Useful for memory-comparison benches.
Sourcepub fn insert(&mut self, key: u64, value: V) -> Option<V>
pub fn insert(&mut self, key: u64, value: V) -> Option<V>
Insert a (key, value). Pre-seal: O(log N_shard) BTreeMap
insert. Update returns the previous value.
Sourcepub fn get(&self, key: u64) -> Option<&V>
pub fn get(&self, key: u64) -> Option<&V>
Lookup a key. Pre-seal goes through the BTreeMap; post-seal goes through the packed front directory + microbuckets.
pub fn contains_key(&self, key: u64) -> bool
Sourcepub fn seal_for_lookup(&mut self)
pub fn seal_for_lookup(&mut self)
Build the sealed lookup index. Groups leaves by their 16-bit front prefix, packs each group into the smallest microbucket that fits, and writes the packed entry into the sparse paged front directory.
Sourcepub fn iter_sorted(&self) -> Vec<(u64, &V)>
pub fn iter_sorted(&self) -> Vec<(u64, &V)>
Iterate all entries in canonical (key-sorted) order. The pre-seal BTreeMap iteration is already sorted; post-seal we re-sort because micro buckets aren’t key-sorted.
Trait Implementations§
Source§impl<V: Clone + Clone> Clone for DHarhtMemory<V>
impl<V: Clone + Clone> Clone for DHarhtMemory<V>
Source§fn clone(&self) -> DHarhtMemory<V>
fn clone(&self) -> DHarhtMemory<V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<V> Freeze for DHarhtMemory<V>
impl<V> RefUnwindSafe for DHarhtMemory<V>where
V: RefUnwindSafe,
impl<V> Send for DHarhtMemory<V>where
V: Send,
impl<V> Sync for DHarhtMemory<V>where
V: Sync,
impl<V> Unpin for DHarhtMemory<V>where
V: Unpin,
impl<V> UnsafeUnpin for DHarhtMemory<V>
impl<V> UnwindSafe for DHarhtMemory<V>where
V: RefUnwindSafe + UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more