pub struct UnsortedMap<K, V>{ /* private fields */ }
Expand description
An unsorted map that is oblivious to the access pattern.
The map uses cuckoo hashing with size-2 buckets, two tables and a deamortization queue.
INSERTION_QUEUE_MAX_SIZE
is the maximum size of the deamortization queue.
DEAMORTIZED_INSERTIONS
is the number of deamortized insertions to perform per insert call.
§Invariants
- A key appears at most once in a valid element in between the two tables and the insertion queue.
- The two tables have the same capacity.
- The two tables have a different hash functions (different keys on the keyed hash function).
Implementations§
Source§impl<K, V> UnsortedMap<K, V>
impl<K, V> UnsortedMap<K, V>
Sourcepub fn deamortize_insertion_queue(&mut self)
pub fn deamortize_insertion_queue(&mut self)
Deamortizes the insertion queue by trying to insert elements into the tables.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for UnsortedMap<K, V>
impl<K, V> !RefUnwindSafe for UnsortedMap<K, V>
impl<K, V> !Send for UnsortedMap<K, V>
impl<K, V> !Sync for UnsortedMap<K, V>
impl<K, V> Unpin for UnsortedMap<K, V>
impl<K, V> !UnwindSafe for UnsortedMap<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