pub struct SplayTree<V> { /* private fields */ }Expand description
A splay tree mapping u64 keys to values of type V.
Implementations§
Source§impl<V> SplayTree<V>
impl<V> SplayTree<V>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn find(&mut self, key: u64) -> Option<&mut V>
pub fn find(&mut self, key: u64) -> Option<&mut V>
Find key; returns reference to value or None. Splays the found node (or last visited) to root.
Sourcepub fn insert_or_get(&mut self, key: u64, value: V) -> &mut V
pub fn insert_or_get(&mut self, key: u64, value: V) -> &mut V
Insert key with value if absent; returns mutable reference to the (possibly pre-existing) value. Splays to root.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for SplayTree<V>
impl<V> RefUnwindSafe for SplayTree<V>where
V: RefUnwindSafe,
impl<V> !Send for SplayTree<V>
impl<V> !Sync for SplayTree<V>
impl<V> Unpin for SplayTree<V>
impl<V> UnsafeUnpin for SplayTree<V>
impl<V> UnwindSafe for SplayTree<V>where
V: RefUnwindSafe,
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