[][src]Trait libra_jellyfish_merkle::TreeReader

pub trait TreeReader {
    fn get_node_option(&self, node_key: &NodeKey) -> Result<Option<Node>>;
fn get_rightmost_leaf(&self) -> Result<Option<(NodeKey, LeafNode)>>; fn get_node(&self, node_key: &NodeKey) -> Result<Node> { ... } }

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

Required methods

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

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

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

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.

Loading content...

Provided methods

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

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

Loading content...


Loading content...