Trait trie_db::TrieConfiguration[][src]

pub trait TrieConfiguration: Sized + TrieLayout {
    fn trie_build<DB, I, A, B>(
        db: &mut DB,
        input: I
    ) -> <Self::Hash as Hasher>::Out
    where
        DB: HashDB<Self::Hash, usize>,
        I: IntoIterator<Item = (A, B)>,
        A: AsRef<[u8]> + Ord,
        B: AsRef<[u8]>
, { ... }
fn trie_root<I, A, B>(input: I) -> <Self::Hash as Hasher>::Out
    where
        I: IntoIterator<Item = (A, B)>,
        A: AsRef<[u8]> + Ord,
        B: AsRef<[u8]>
, { ... }
fn trie_root_unhashed<I, A, B>(input: I) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator

    where
        I: IntoIterator<Item = (A, B)>,
        A: AsRef<[u8]> + Ord,
        B: AsRef<[u8]>
, { ... }
fn encode_index(input: u32) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
{ ... }
fn ordered_trie_root<I, A>(input: I) -> <Self::Hash as Hasher>::Out
    where
        I: IntoIterator<Item = A>,
        A: AsRef<[u8]>
, { ... } }

This trait associates a trie definition with preferred methods. It also contains own default implementations and can be used to allow switching implementation.

Provided methods

fn trie_build<DB, I, A, B>(db: &mut DB, input: I) -> <Self::Hash as Hasher>::Out where
    DB: HashDB<Self::Hash, usize>,
    I: IntoIterator<Item = (A, B)>,
    A: AsRef<[u8]> + Ord,
    B: AsRef<[u8]>, 
[src]

Operation to build a trie db from its ordered iterator over its key/values.

fn trie_root<I, A, B>(input: I) -> <Self::Hash as Hasher>::Out where
    I: IntoIterator<Item = (A, B)>,
    A: AsRef<[u8]> + Ord,
    B: AsRef<[u8]>, 
[src]

Determines a trie root given its ordered contents, closed form.

fn trie_root_unhashed<I, A, B>(input: I) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
where
    I: IntoIterator<Item = (A, B)>,
    A: AsRef<[u8]> + Ord,
    B: AsRef<[u8]>, 
[src]

Determines a trie root node’s data given its ordered contents, closed form.

fn encode_index(input: u32) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Encoding of index as a key (when reusing general trie for indexed trie).

fn ordered_trie_root<I, A>(input: I) -> <Self::Hash as Hasher>::Out where
    I: IntoIterator<Item = A>,
    A: AsRef<[u8]>, 
[src]

A trie root formed from the items, with keys attached according to their compact-encoded index (using parity-codec crate).

Loading content...

Implementors

Loading content...