[−][src]Trait multiproof_rs::tree::Tree
A trait representing the an underlying tree structure.
Required methods
fn is_leaf(&self) -> bool
Specifies if the current tree is a simple leaf.
fn is_empty(&self) -> bool
Specifies if the current tree is empty.
fn num_children(&self) -> usize
Returns the tree root's maximal number of children.
fn ith_child(&self, index: usize) -> Option<&Self>
Returns a pointer to child #i, or None
if no such child exists.
fn set_ith_child(&mut self, index: usize, child: &Self)
Set child node #i of the current node.
fn insert(&mut self, key: &N::Key, value: N::Value) -> Result<(), String>
Insert a (key,value)
pair into a (sub-)tree represented by root
.
fn has_key(&self, key: &N::Key) -> bool
Returns true
if the current tree contains key
as a key.
fn value(&self) -> Option<&N::Value>
fn value_length(&self) -> Option<usize>
fn from_hash(h: Vec<u8>) -> Self
fn new_empty() -> Self
fn new_extension(ext: Vec<u8>, child: Self) -> Self
fn new_branch() -> Self
fn new_leaf(key: Vec<u8>, value: Vec<u8>) -> Self
Provided methods
ⓘImportant traits for NodeChildIterator<'a, N, T>fn children(&self) -> NodeChildIterator<N, Self>
ⓘImportant traits for NodeChildIterator<'a, N, T>
Returns an iterator to the node's children. Some of these nodes can be empty.
Implementors
impl Tree<BinaryTree> for BinaryTree
[src]
fn is_leaf(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]
fn num_children(&self) -> usize
[src]
fn ith_child(&self, index: usize) -> Option<&Self>
[src]
fn set_ith_child(&mut self, index: usize, child: &Self)
[src]
fn insert(&mut self, key: &BinaryKey, value: Vec<u8>) -> Result<(), String>
[src]
fn has_key(&self, key: &BinaryKey) -> bool
[src]
fn value(&self) -> Option<&Vec<u8>>
[src]
fn value_length(&self) -> Option<usize>
[src]
fn from_hash(h: Vec<u8>) -> Self
[src]
fn new_extension(_ext: Vec<u8>, _child: Self) -> Self
[src]
fn new_branch() -> Self
[src]
fn new_leaf(key: Vec<u8>, value: Vec<u8>) -> Self
[src]
fn new_empty() -> Self
[src]
impl Tree<Node> for Node
[src]
fn is_leaf(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]
fn num_children(&self) -> usize
[src]
Returns the maximum child count of the tree's root.
Branch nodes will always report 16, as empty slots are counted as children.
fn ith_child(&self, index: usize) -> Option<&Self>
[src]
Return the tree root's ith child.
The function will return EmptySlot
instead of None
if a branch node has no ith child.