pub struct Tree<K: Ord, V> { /* private fields */ }
Implementations§
Source§impl<K: Ord, V> Tree<K, V>
impl<K: Ord, V> Tree<K, V>
pub fn new(value: V) -> Tree<K, V>
pub fn value(&self) -> &V
pub fn value_mut(&mut self) -> &mut V
pub fn set_value(&mut self, value: V) -> V
pub fn children_keys(&self) -> Keys<'_, K, Self>
pub fn children(&self) -> Values<'_, K, Self>
pub fn children_mut(&mut self) -> ValuesMut<'_, K, Self>
Sourcepub fn iter_single(&self) -> Iter<'_, K, Self>
pub fn iter_single(&self) -> Iter<'_, K, Self>
An iterator visiting the children without nesting
Sourcepub fn iter_single_mut(&mut self) -> IterMut<'_, K, Self>
pub fn iter_single_mut(&mut self) -> IterMut<'_, K, Self>
An iterator visiting the children without nesting and returning mutable references
pub fn iter_depth_first(&self) -> DepthFirstIter<'_, K, V> ⓘ
pub fn iter_depth_first_mut(&mut self) -> DepthFirstIterMut<'_, K, V> ⓘ
pub fn iter_breadth_first(&self) -> BreadthFirstIter<'_, K, V> ⓘ
pub fn iter_breadth_first_mut(&mut self) -> BreadthFirstIterMut<'_, K, V> ⓘ
pub fn child_count(&mut self) -> usize
pub fn is_childless(&self) -> bool
pub fn clear(&mut self)
pub fn entry(&mut self, key: K) -> Entry<'_, K, V>
pub fn get_child<Q>(&self, key: &Q) -> Option<&Self>
pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&K, &Self)>
pub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn get_child_mut<Q>(&mut self, key: &Q) -> Option<&mut Self>
pub fn add_child(&mut self, key: K, value: V) -> (Option<V>, &mut Self)
pub fn remove<Q>(&mut self, key: &Q) -> Option<Self>
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, Self)>
pub fn retain<F>(&mut self, f: F)
pub fn into_keys(self) -> IntoKeys<K, Self>
pub fn into_values(self) -> IntoValues<K, Self>
Trait Implementations§
Source§impl<K: Ord, V> IntoIterator for Tree<K, V>
impl<K: Ord, V> IntoIterator for Tree<K, V>
Source§impl<K: Ord + Ord, V: Ord> Ord for Tree<K, V>
impl<K: Ord + Ord, V: Ord> Ord for Tree<K, V>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for Tree<K, V>
impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for Tree<K, V>
impl<K: Eq + Ord, V: Eq> Eq for Tree<K, V>
impl<K: Ord, V> StructuralPartialEq for Tree<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Tree<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for Tree<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for Tree<K, V>
impl<K, V> Sync for Tree<K, V>
impl<K, V> Unpin for Tree<K, V>where
V: Unpin,
impl<K, V> UnwindSafe for Tree<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