Struct reference_trie::ReferenceNodeCodecNoExt
source · [−]pub struct ReferenceNodeCodecNoExt<H>(_);Expand description
Simple reference implementation of a NodeCodec.
Even if implementation follows initial specification of
https://github.com/w3f/polkadot-re-spec/issues/8, this may
not follow it in the future, it is mainly the testing codec without extension node.
Trait Implementations
Returns the “default value” for a type. Read more
type Error = CodecError
type Error = CodecError
Codec error type.
Get the hashed null node.
Decode bytes to a NodePlan. Returns Self::E on failure.
Check if the provided bytes correspond to the codecs “empty” node.
Returns an encoded empty node.
fn extension_node(
_partial: impl Iterator<Item = u8>,
_nbnibble: usize,
_child: ChildReference<<H as Hasher>::Out>
) -> Vec<u8>
fn extension_node(
_partial: impl Iterator<Item = u8>,
_nbnibble: usize,
_child: ChildReference<<H as Hasher>::Out>
) -> Vec<u8>
Returns an encoded extension node
Note that number_nibble is the number of element of the iterator
it can possibly be obtain by Iterator size_hint, but
for simplicity it is used directly as a parameter. Read more
Returns an encoded branch node.
Takes an iterator yielding ChildReference<Self::HashOut> and an optional value. Read more
Returns an encoded branch node with a possible partial path.
number_nibble is the partial path length as in extension_node. Read more
Escape header byte sequence to indicate next node is a branch or leaf with hash of value, followed by the value node. Read more
Auto Trait Implementations
impl<H> RefUnwindSafe for ReferenceNodeCodecNoExt<H> where
H: RefUnwindSafe,
impl<H> Send for ReferenceNodeCodecNoExt<H> where
H: Send,
impl<H> Sync for ReferenceNodeCodecNoExt<H> where
H: Sync,
impl<H> Unpin for ReferenceNodeCodecNoExt<H> where
H: Unpin,
impl<H> UnwindSafe for ReferenceNodeCodecNoExt<H> where
H: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more