pub struct DetMap { /* private fields */ }Expand description
A deterministic hash map with insertion-order iteration. Uses open addressing with Fibonacci hashing.
Implementations§
Source§impl DetMap
impl DetMap
Sourcepub fn insert(&mut self, key: Value, value: Value)
pub fn insert(&mut self, key: Value, value: Value)
Insert a key-value pair into the map.
If the key already exists, its value is overwritten and its original insertion position is preserved. Triggers a rehash (doubling capacity) when the load factor exceeds 75%.
Sourcepub fn get(&self, key: &Value) -> Option<&Value>
pub fn get(&self, key: &Value) -> Option<&Value>
Look up a value by key. Returns None if the key is not present.
Sourcepub fn contains_key(&self, key: &Value) -> bool
pub fn contains_key(&self, key: &Value) -> bool
Return true if the map contains the given key.
Sourcepub fn remove(&mut self, key: &Value) -> Option<Value>
pub fn remove(&mut self, key: &Value) -> Option<Value>
Remove a key from the map, returning its value if it was present.
Uses Robin Hood-style backward-shift deletion to maintain probe chain correctness. The insertion-order vector is updated in place so that iteration order of remaining entries is preserved.
Sourcepub fn values_vec(&self) -> Vec<Value>
pub fn values_vec(&self) -> Vec<Value>
Collect all values in insertion order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DetMap
impl !RefUnwindSafe for DetMap
impl !Send for DetMap
impl !Sync for DetMap
impl Unpin for DetMap
impl UnsafeUnpin for DetMap
impl !UnwindSafe for DetMap
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
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>
Converts
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>
Converts
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