[][src]Enum multiproof_rs::node::Node

pub enum Node {
    Hash(Vec<u8>),
    Leaf(NibbleKeyVec<u8>),
    Extension(NibbleKeyBox<Node>),
    Branch(Vec<Node>),
    EmptySlot,
}

Variants

Hash(Vec<u8>)
Leaf(NibbleKeyVec<u8>)
Extension(NibbleKeyBox<Node>)
Branch(Vec<Node>)
EmptySlot

Methods

impl Node[src]

pub fn graphviz(&self) -> String[src]

pub fn is_key_present(&self, key: &NibbleKey) -> bool[src]

pub fn hash(&self) -> Vec<u8>[src]

pub fn composition(&self) -> Vec<u8>[src]

Trait Implementations

impl KeyValueStore for Node[src]

type Key = NibbleKey

The tree's key type. Must be specified when implementing this trait.

type Value = Vec<u8>

The tree's value type. Must be specified when implementing this trait.

impl Tree<Node> for Node[src]

fn num_children(&self) -> usize[src]

Returns the maximum child count of the tree's root.

Branch nodes will always report 16, as empty slots are counted as children.

fn ith_child(&self, index: usize) -> Option<&Self>[src]

Return the tree root's ith child.

The function will return EmptySlot instead of None if a branch node has no ith child.

impl Clone for Node[src]

impl Default for Node[src]

impl PartialEq<Node> for Node[src]

impl Debug for Node[src]

impl<'_> Index<&'_ NibbleKey> for Node[src]

type Output = Node

The returned type after indexing.

impl StructuralPartialEq for Node[src]

impl Decodable for Node[src]

impl Encodable for Node[src]

Auto Trait Implementations

impl Send for Node

impl Sync for Node

impl Unpin for Node

impl UnwindSafe for Node

impl RefUnwindSafe for Node

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self