[−][src]Trait bm::Backend
Traits for a merkle database.
Associated Types
type Intermediate: Clone
Intermediate value stored in this merkle database.
type End: Clone + Default
End value stored in this merkle database.
type Error
Error type for DB access.
Required methods
fn intermediate_of(
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
Get the intermediate value of given left and right child.
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
Get or create the empty value at given depth-to-bottom.
fn get(
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
Get an internal item by key.
fn rootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
Rootify a key.
fn unrootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
Unrootify a key.
fn insert(
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
Insert a new internal item.
Implementors
impl<'a, DB: Backend> Backend for ProvingBackend<'a, DB> where
IntermediateOf<DB>: Eq + Hash,
[src]
IntermediateOf<DB>: Eq + Hash,
type Intermediate = DB::Intermediate
type End = DB::End
type Error = DB::Error
fn intermediate_of(
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
[src]
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
fn get(
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
[src]
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
fn rootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn unrootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn insert(
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
[src]
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
impl<D: Digest, V: AsRef<[u8]> + Clone + Default> Backend for NoopBackend<D, V>
[src]
type Intermediate = GenericArray<u8, D::OutputSize>
type End = V
type Error = NoopBackendError
fn intermediate_of(
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
[src]
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
fn get(
&self,
_key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
[src]
&self,
_key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
fn rootify(&mut self, _key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn unrootify(&mut self, _key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn insert(
&mut self,
_key: IntermediateOf<Self>,
_value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
[src]
&mut self,
_key: IntermediateOf<Self>,
_value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
impl<D: Digest, V: AsRef<[u8]> + Clone + Default> Backend for InMemoryBackend<D, V>
[src]
type Intermediate = GenericArray<u8, D::OutputSize>
type End = V
type Error = InMemoryBackendError
fn intermediate_of(
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
[src]
&self,
left: &ValueOf<Self>,
right: &ValueOf<Self>
) -> IntermediateOf<Self>
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<ValueOf<Self>, Self::Error>
fn get(
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
[src]
&self,
key: &IntermediateOf<Self>
) -> Result<(ValueOf<Self>, ValueOf<Self>), Self::Error>
fn rootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn unrootify(&mut self, key: &IntermediateOf<Self>) -> Result<(), Self::Error>
[src]
fn insert(
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>
[src]
&mut self,
key: IntermediateOf<Self>,
value: (ValueOf<Self>, ValueOf<Self>)
) -> Result<(), Self::Error>