[−][src]Trait bm_le::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: &Value<Self::Intermediate, Self::End>,
right: &Value<Self::Intermediate, Self::End>
) -> Self::Intermediate
&self,
left: &Value<Self::Intermediate, Self::End>,
right: &Value<Self::Intermediate, Self::End>
) -> Self::Intermediate
Get the intermediate value of given left and right child.
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<Value<Self::Intermediate, Self::End>, Self::Error>
&mut self,
depth_to_bottom: usize
) -> Result<Value<Self::Intermediate, Self::End>, Self::Error>
Get or create the empty value at given depth-to-bottom.
fn get(
&self,
key: &Self::Intermediate
) -> Result<(Value<Self::Intermediate, Self::End>, Value<Self::Intermediate, Self::End>), Self::Error>
&self,
key: &Self::Intermediate
) -> Result<(Value<Self::Intermediate, Self::End>, Value<Self::Intermediate, Self::End>), Self::Error>
Get an internal item by key.
fn rootify(&mut self, key: &Self::Intermediate) -> Result<(), Self::Error>
Rootify a key.
fn unrootify(&mut self, key: &Self::Intermediate) -> Result<(), Self::Error>
Unrootify a key.
fn insert(
&mut self,
key: Self::Intermediate,
value: (Value<Self::Intermediate, Self::End>, Value<Self::Intermediate, Self::End>)
) -> Result<(), Self::Error>
&mut self,
key: Self::Intermediate,
value: (Value<Self::Intermediate, Self::End>, Value<Self::Intermediate, Self::End>)
) -> Result<(), Self::Error>
Insert a new internal item.
Implementations on Foreign Types
impl<'a, DB> Backend for ProvingBackend<'a, DB> where
DB: Backend,
<DB as Backend>::Intermediate: Eq,
<DB as Backend>::Intermediate: Hash,
[src]
DB: Backend,
<DB as Backend>::Intermediate: Eq,
<DB as Backend>::Intermediate: Hash,
type Intermediate = <DB as Backend>::Intermediate
type End = <DB as Backend>::End
type Error = <DB as Backend>::Error
fn intermediate_of(
&self,
left: &Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>,
right: &Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>
) -> <ProvingBackend<'a, DB> as Backend>::Intermediate
[src]
&self,
left: &Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>,
right: &Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>
) -> <ProvingBackend<'a, DB> as Backend>::Intermediate
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, <ProvingBackend<'a, DB> as Backend>::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, <ProvingBackend<'a, DB> as Backend>::Error>
fn get(
&self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>), <ProvingBackend<'a, DB> as Backend>::Error>
[src]
&self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>), <ProvingBackend<'a, DB> as Backend>::Error>
fn rootify(
&mut self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
[src]
&mut self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
fn unrootify(
&mut self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
[src]
&mut self,
key: &<ProvingBackend<'a, DB> as Backend>::Intermediate
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
fn insert(
&mut self,
key: <ProvingBackend<'a, DB> as Backend>::Intermediate,
value: (Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>)
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
[src]
&mut self,
key: <ProvingBackend<'a, DB> as Backend>::Intermediate,
value: (Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>, Value<<ProvingBackend<'a, DB> as Backend>::Intermediate, <ProvingBackend<'a, DB> as Backend>::End>)
) -> Result<(), <ProvingBackend<'a, DB> as Backend>::Error>
Implementors
impl<D, V> Backend for InMemoryBackend<D, V> where
D: Digest,
V: Clone + Default + AsRef<[u8]>,
[src]
D: Digest,
V: Clone + Default + AsRef<[u8]>,
type Intermediate = GenericArray<u8, <D as Digest>::OutputSize>
type End = V
type Error = InMemoryBackendError
fn intermediate_of(
&self,
left: &Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>,
right: &Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>
) -> <InMemoryBackend<D, V> as Backend>::Intermediate
[src]
&self,
left: &Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>,
right: &Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>
) -> <InMemoryBackend<D, V> as Backend>::Intermediate
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, <InMemoryBackend<D, V> as Backend>::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, <InMemoryBackend<D, V> as Backend>::Error>
fn get(
&self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>), <InMemoryBackend<D, V> as Backend>::Error>
[src]
&self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>), <InMemoryBackend<D, V> as Backend>::Error>
fn rootify(
&mut self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
[src]
&mut self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
fn unrootify(
&mut self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
[src]
&mut self,
key: &<InMemoryBackend<D, V> as Backend>::Intermediate
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
fn insert(
&mut self,
key: <InMemoryBackend<D, V> as Backend>::Intermediate,
value: (Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>)
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
[src]
&mut self,
key: <InMemoryBackend<D, V> as Backend>::Intermediate,
value: (Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>, Value<<InMemoryBackend<D, V> as Backend>::Intermediate, <InMemoryBackend<D, V> as Backend>::End>)
) -> Result<(), <InMemoryBackend<D, V> as Backend>::Error>
impl<D, V> Backend for NoopBackend<D, V> where
D: Digest,
V: Clone + Default + AsRef<[u8]>,
[src]
D: Digest,
V: Clone + Default + AsRef<[u8]>,
type Intermediate = GenericArray<u8, <D as Digest>::OutputSize>
type End = V
type Error = NoopBackendError
fn intermediate_of(
&self,
left: &Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>,
right: &Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>
) -> <NoopBackend<D, V> as Backend>::Intermediate
[src]
&self,
left: &Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>,
right: &Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>
) -> <NoopBackend<D, V> as Backend>::Intermediate
fn empty_at(
&mut self,
depth_to_bottom: usize
) -> Result<Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, <NoopBackend<D, V> as Backend>::Error>
[src]
&mut self,
depth_to_bottom: usize
) -> Result<Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, <NoopBackend<D, V> as Backend>::Error>
fn get(
&self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>), <NoopBackend<D, V> as Backend>::Error>
[src]
&self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>), <NoopBackend<D, V> as Backend>::Error>
fn rootify(
&mut self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>
[src]
&mut self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>
fn unrootify(
&mut self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>
[src]
&mut self,
_key: &<NoopBackend<D, V> as Backend>::Intermediate
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>
fn insert(
&mut self,
_key: <NoopBackend<D, V> as Backend>::Intermediate,
_value: (Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>)
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>
[src]
&mut self,
_key: <NoopBackend<D, V> as Backend>::Intermediate,
_value: (Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>, Value<<NoopBackend<D, V> as Backend>::Intermediate, <NoopBackend<D, V> as Backend>::End>)
) -> Result<(), <NoopBackend<D, V> as Backend>::Error>