pub struct Treap<K, V> { /* private fields */ }Implementations§
Source§impl<K: Ord, V> Treap<K, V>
impl<K: Ord, V> Treap<K, V>
pub fn new(seed: u64) -> Self
Sourcepub fn with_capacity(seed: u64, capacity: usize) -> Self
pub fn with_capacity(seed: u64, capacity: usize) -> Self
Construct with capacity pre-allocated. Use when an upper bound on the working set is known: avoids the doubling-vec growth path during the first burst of inserts.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn get(&self, key: &K) -> Option<&V>
pub fn remove(&mut self, key: &K) -> Option<V>
Sourcepub fn collect_in_order(&self) -> Vec<(&K, &V)>
pub fn collect_in_order(&self) -> Vec<(&K, &V)>
In-order traversal; pushes (key, value) references into a Vec.
Auto Trait Implementations§
impl<K, V> Freeze for Treap<K, V>
impl<K, V> RefUnwindSafe for Treap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Treap<K, V>
impl<K, V> Sync for Treap<K, V>
impl<K, V> Unpin for Treap<K, V>
impl<K, V> UnsafeUnpin for Treap<K, V>
impl<K, V> UnwindSafe for Treap<K, V>where
K: UnwindSafe,
V: 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
Mutably borrows from an owned value. Read more