[−][src]Trait reference_trie::NodeCodec
Trait for trie node encoding/decoding
Associated Types
Loading content...Required methods
fn hashed_null_node() -> <H as Hasher>::Out
Get the hashed null node.
fn decode(data: &[u8]) -> Result<Node, Self::Error>
Decode bytes to a Node
. Returns Self::E
on failure.
fn try_decode_hash(data: &[u8]) -> Option<<H as Hasher>::Out>
Decode bytes to the Hasher
s output type. Returns None
on failure.
fn is_empty_node(data: &[u8]) -> bool
Check if the provided bytes correspond to the codecs "empty" node.
fn empty_node() -> Vec<u8>
Returns an empty node
fn leaf_node(partial: &[u8], value: &[u8]) -> Vec<u8>
Returns an encoded leaf node
fn ext_node(
partial: &[u8],
child_ref: ChildReference<<H as Hasher>::Out>
) -> Vec<u8>
partial: &[u8],
child_ref: ChildReference<<H as Hasher>::Out>
) -> Vec<u8>
Returns an encoded extension node
fn branch_node<I>(children: I, value: Option<ElasticArray128<u8>>) -> Vec<u8> where
I: IntoIterator<Item = Option<ChildReference<<H as Hasher>::Out>>> + Iterator<Item = Option<ChildReference<<H as Hasher>::Out>>>,
I: IntoIterator<Item = Option<ChildReference<<H as Hasher>::Out>>> + Iterator<Item = Option<ChildReference<<H as Hasher>::Out>>>,
Returns an encoded branch node. Takes an iterator yielding ChildReference<H::Out>
and an optional value
Implementors
impl NodeCodec<KeccakHasher> for ReferenceNodeCodec
[src]
impl NodeCodec<KeccakHasher> for ReferenceNodeCodec
type Error = ReferenceError
fn hashed_null_node() -> <KeccakHasher as Hasher>::Out | [src] |
fn decode(data: &[u8]) -> Result<Node, Self::Error> | [src] |
fn try_decode_hash(data: &[u8]) -> Option<<KeccakHasher as Hasher>::Out> | [src] |
fn is_empty_node(data: &[u8]) -> bool | [src] |
fn empty_node() -> Vec<u8> | [src] |
fn leaf_node(partial: &[u8], value: &[u8]) -> Vec<u8> | [src] |
fn ext_node( | [src] |
fn branch_node<I>(children: I, maybe_value: Option<DBValue>) -> Vec<u8> where | [src] |