pub struct SplayTree<K, V, C>{ /* private fields */ }
Implementations§
Source§impl<K, V, C> SplayTree<K, V, C>
impl<K, V, C> SplayTree<K, V, C>
pub fn new(comparator: C) -> SplayTree<K, V, C>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn contains(&self, key: &K) -> bool
pub fn get(&self, key: &K) -> Option<&V>
Sourcepub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
Return a mutable reference to the value corresponding to the key
pub fn find_key(&self, key: &K) -> Option<&K>
pub fn next(&self, key: &K) -> Option<(&K, &V)>
pub fn prev(&self, key: &K) -> Option<(&K, &V)>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
pub fn min(&self) -> Option<&K>
pub fn max(&self) -> Option<&K>
Trait Implementations§
Source§impl<K, V, C> Extend<(K, V)> for SplayTree<K, V, C>
impl<K, V, C> Extend<(K, V)> for SplayTree<K, V, C>
Source§fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, i: I)
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, i: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K, V, C> IntoIterator for SplayTree<K, V, C>
impl<K, V, C> IntoIterator for SplayTree<K, V, C>
Auto Trait Implementations§
impl<K, V, C> !Freeze for SplayTree<K, V, C>
impl<K, V, C> !RefUnwindSafe for SplayTree<K, V, C>
impl<K, V, C> Send for SplayTree<K, V, C>
impl<K, V, C> !Sync for SplayTree<K, V, C>
impl<K, V, C> Unpin for SplayTree<K, V, C>where
C: Unpin,
impl<K, V, C> UnwindSafe for SplayTree<K, V, C>
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