Trait tetsy_reference_trie::TrieStream[][src]

pub trait TrieStream {
    pub fn new() -> Self;
pub fn append_empty_data(&mut self);
pub fn begin_branch(
        &mut self,
        maybe_key: Option<&[u8]>,
        maybe_value: Option<&[u8]>,
        has_children: impl Iterator<Item = bool>
    );
pub fn append_leaf(&mut self, key: &[u8], value: &[u8]);
pub fn append_extension(&mut self, key: &[u8]);
pub fn append_substream<H>(&mut self, other: Self)
    where
        H: Hasher
;
pub fn out(self) -> Vec<u8, Global>; pub fn append_empty_child(&mut self) { ... }
pub fn end_branch(&mut self, _value: Option<&[u8]>) { ... } }

Byte-stream oriented trait for constructing closed-form tries.

Required methods

pub fn new() -> Self[src]

Construct a new TrieStream

pub fn append_empty_data(&mut self)[src]

Append an Empty node

pub fn begin_branch(
    &mut self,
    maybe_key: Option<&[u8]>,
    maybe_value: Option<&[u8]>,
    has_children: impl Iterator<Item = bool>
)
[src]

Start a new Branch node, possibly with a value; takes a list indicating which slots in the Branch node has further child nodes.

pub fn append_leaf(&mut self, key: &[u8], value: &[u8])[src]

Append a Leaf node

pub fn append_extension(&mut self, key: &[u8])[src]

Append an Extension node

pub fn append_substream<H>(&mut self, other: Self) where
    H: Hasher
[src]

Append a Branch of Extension substream

pub fn out(self) -> Vec<u8, Global>[src]

Return the finished TrieStream as a vector of bytes.

Loading content...

Provided methods

pub fn append_empty_child(&mut self)[src]

Append an empty child node. Optional.

pub fn end_branch(&mut self, _value: Option<&[u8]>)[src]

Wrap up a Branch node portion of a TrieStream and append the value stored on the Branch (if any).

Loading content...

Implementors

impl TrieStream for ReferenceTrieStream[src]

impl TrieStream for ReferenceTrieStreamNoExt[src]

Loading content...