[][src]Enum casperlabs_engine_storage::trie::Trie

pub enum Trie<K, V> {
    Leaf {
        key: K,
        value: V,
    },
    Node {
        pointer_block: Box<PointerBlock>,
    },
    Extension {
        affix: Vec<u8>,
        pointer: Pointer,
    },
}

Represents a Merkle Trie

Variants

Leaf

Fields of Leaf

key: Kvalue: V
Node

Fields of Node

pointer_block: Box<PointerBlock>
Extension

Fields of Extension

affix: Vec<u8>pointer: Pointer

Methods

impl<K, V> Trie<K, V>[src]

pub fn leaf(key: K, value: V) -> Self[src]

Constructs a Trie::Leaf from a given key and value.

pub fn node(indexed_pointers: &[(usize, Pointer)]) -> Self[src]

Constructs a Trie::Node from a given slice of indexed pointers.

pub fn extension(affix: Vec<u8>, pointer: Pointer) -> Self[src]

Constructs a Trie::Extension from a given affix and pointer.

pub fn key(&self) -> Option<&K>[src]

Trait Implementations

impl<K: Clone, V: Clone> Clone for Trie<K, V>[src]

impl<K: Debug, V: Debug> Debug for Trie<K, V>[src]

impl<K: Eq, V: Eq> Eq for Trie<K, V>[src]

impl<K: FromBytes, V: FromBytes> FromBytes for Trie<K, V>[src]

impl<K: PartialEq, V: PartialEq> PartialEq<Trie<K, V>> for Trie<K, V>[src]

impl<K, V> Store<Blake2bHash, Trie<K, V>> for InMemoryTrieStore[src]

type Error = Error

type Handle = Option<String>

impl<K, V> Store<Blake2bHash, Trie<K, V>> for LmdbTrieStore[src]

type Error = Error

type Handle = Database

impl<K, V> StructuralEq for Trie<K, V>[src]

impl<K, V> StructuralPartialEq for Trie<K, V>[src]

impl<K, V> ToBytes for Trie<K, V> where
    K: ToBytes,
    V: ToBytes
[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Trie<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for Trie<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Trie<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Trie<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Trie<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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 = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>,