[][src]Trait sparse_merkle_tree::traits::Store

pub trait Store<V> {
    fn get_branch(&self, node: &H256) -> Result<Option<BranchNode>, Error>;
fn get_leaf(&self, leaf_hash: &H256) -> Result<Option<LeafNode<V>>, Error>;
fn insert_branch(
        &mut self,
        node: H256,
        branch: BranchNode
    ) -> Result<(), Error>;
fn insert_leaf(
        &mut self,
        leaf_hash: H256,
        leaf: LeafNode<V>
    ) -> Result<(), Error>;
fn remove_branch(&mut self, node: &H256) -> Result<(), Error>;
fn remove_leaf(&mut self, leaf_hash: &H256) -> Result<(), Error>; }

Trait for customize backend storage

Required methods

fn get_branch(&self, node: &H256) -> Result<Option<BranchNode>, Error>

fn get_leaf(&self, leaf_hash: &H256) -> Result<Option<LeafNode<V>>, Error>

fn insert_branch(&mut self, node: H256, branch: BranchNode) -> Result<(), Error>

fn insert_leaf(
    &mut self,
    leaf_hash: H256,
    leaf: LeafNode<V>
) -> Result<(), Error>

fn remove_branch(&mut self, node: &H256) -> Result<(), Error>

fn remove_leaf(&mut self, leaf_hash: &H256) -> Result<(), Error>

Loading content...

Implementors

impl<V: Clone> Store<V> for DefaultStore<V>[src]

Loading content...