pub trait TreeReader<V> {
    // Required methods
    fn get_node_option(&self, node_key: &NodeKey) -> Result<Option<Node<V>>>;
    fn get_rightmost_leaf(&self) -> Result<Option<(NodeKey, LeafNode<V>)>>;

    // Provided method
    fn get_node(&self, node_key: &NodeKey) -> Result<Node<V>> { ... }
}
Expand description

TreeReader defines the interface between JellyfishMerkleTree and underlying storage holding nodes.

Required Methods§

source

fn get_node_option(&self, node_key: &NodeKey) -> Result<Option<Node<V>>>

Gets node given a node key. Returns None if the node does not exist.

source

fn get_rightmost_leaf(&self) -> Result<Option<(NodeKey, LeafNode<V>)>>

Gets the rightmost leaf. Note that this assumes we are in the process of restoring the tree and all nodes are at the same version.

Provided Methods§

source

fn get_node(&self, node_key: &NodeKey) -> Result<Node<V>>

Gets node given a node key. Returns error if the node does not exist.

Implementors§