pub trait Store<N: Node> {
// Required methods
fn get_node(&self, id: &TreeID) -> Result<N, Error>;
fn set_node(&mut self, id: TreeID, node: N) -> Result<(), Error>;
fn get_leaf(&self, id: &TreeID) -> Result<N, Error>;
fn set_leaf(&mut self, id: TreeID, leaf: N) -> Result<(), Error>;
// Provided methods
fn get(&self, id: &TreeID) -> Result<N, Error> { ... }
fn set(&mut self, id: TreeID, node: N) -> Result<(), Error> { ... }
fn get_many<'a, I: Iterator<Item = TreeID>>(
&self,
ids: I,
) -> Result<BTreeMap<TreeID, N>, Error> { ... }
fn set_many<I: Iterator<Item = (TreeID, N)>>(
&mut self,
nodes: I,
) -> Result<(), Error> { ... }
}
Expand description
Represents access to immutable merkle tree nodes.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.