pub enum NestedTree<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> {
Leaf(V),
Nested(RbTree<K, NestedTree<K, V>>),
}
Variants§
Leaf(V)
Nested(RbTree<K, NestedTree<K, V>>)
Implementations§
source§impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> NestedTree<K, V>
impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> NestedTree<K, V>
pub fn get(&self, path: &[K]) -> Option<&V>
sourcepub fn contains_leaf(&self, path: &[K]) -> bool
pub fn contains_leaf(&self, path: &[K]) -> bool
Returns true if there is a leaf at the specified path
sourcepub fn contains_path(&self, path: &[K]) -> bool
pub fn contains_path(&self, path: &[K]) -> bool
Returns true if there is a leaf or a subtree at the specified path
pub fn insert(&mut self, path: &[K], value: V)
pub fn delete(&mut self, path: &[K])
pub fn witness(&self, path: &[K]) -> HashTree
Trait Implementations§
source§impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> AsHashTree for NestedTree<K, V>
impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> AsHashTree for NestedTree<K, V>
source§impl<K: Clone + NestedTreeKeyRequirements, V: Clone + NestedTreeValueRequirements> Clone for NestedTree<K, V>
impl<K: Clone + NestedTreeKeyRequirements, V: Clone + NestedTreeValueRequirements> Clone for NestedTree<K, V>
source§fn clone(&self) -> NestedTree<K, V>
fn clone(&self) -> NestedTree<K, V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<K: Debug + NestedTreeKeyRequirements, V: Debug + NestedTreeValueRequirements> Debug for NestedTree<K, V>
impl<K: Debug + NestedTreeKeyRequirements, V: Debug + NestedTreeValueRequirements> Debug for NestedTree<K, V>
source§impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> Default for NestedTree<K, V>
impl<K: NestedTreeKeyRequirements, V: NestedTreeValueRequirements> Default for NestedTree<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for NestedTree<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for NestedTree<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for NestedTree<K, V>
impl<K, V> Sync for NestedTree<K, V>
impl<K, V> Unpin for NestedTree<K, V>where
V: Unpin,
impl<K, V> UnwindSafe for NestedTree<K, V>where
V: UnwindSafe,
K: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)