pub struct ZipTree<K, V> { /* private fields */ }Expand description
Tarjan’s zip tree implementation.
The ZipTree API mimics the standard library’s BTreeMap. It provides look-ups, insertions, deletions and iterator interface. Cloning this tree will deep copy overall tree structure, and thus takes O(n) time.
Implementations§
Source§impl<K, V> ZipTree<K, V>where
K: Ord,
impl<K, V> ZipTree<K, V>where
K: Ord,
pub fn new() -> ZipTree<K, V>
pub fn len(&self) -> usize
pub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get_mut<'a, Q>(&'a mut self, key: &Q) -> Option<&'a mut V>
pub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
pub fn iter<'a>(&'a self) -> Iter<'a, K, V> ⓘ
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, K, V> ⓘ
pub fn keys<'a>(&'a self) -> Keys<'a, K, V> ⓘ
pub fn values<'a>(&'a self) -> Values<'a, K, V> ⓘ
pub fn values_mut<'a>(&'a mut self) -> ValuesMut<'a, K, V> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for ZipTree<K, V>
impl<K, V> RefUnwindSafe for ZipTree<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> !Send for ZipTree<K, V>
impl<K, V> !Sync for ZipTree<K, V>
impl<K, V> Unpin for ZipTree<K, V>
impl<K, V> UnwindSafe for ZipTree<K, V>where
K: RefUnwindSafe,
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