Skip to main content

StorageTrieEntryLike

Trait StorageTrieEntryLike 

Source
pub trait StorageTrieEntryLike: Sized {
    type SubKey: Clone;

    // Required methods
    fn nibbles(&self) -> &Self::SubKey;
    fn node(&self) -> &BranchNodeCompact;
    fn into_parts(self) -> (Self::SubKey, BranchNodeCompact);
    fn new(nibbles: Self::SubKey, node: BranchNodeCompact) -> Self;
}
Expand description

Trait for storage trie entry types that carry a subkey and node.

Provides access to the encoded subkey and branch node, as well as construction and decomposition into owned parts, independently of the subkey encoding.

Required Associated Types§

Source

type SubKey: Clone

The subkey type.

Required Methods§

Source

fn nibbles(&self) -> &Self::SubKey

Returns a reference to the nibbles subkey.

Source

fn node(&self) -> &BranchNodeCompact

Returns a reference to the branch node.

Source

fn into_parts(self) -> (Self::SubKey, BranchNodeCompact)

Decompose this value into owned parts.

Source

fn new(nibbles: Self::SubKey, node: BranchNodeCompact) -> Self

Construct a new entry from a subkey and node.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StorageTrieEntryLike for PackedStorageTrieEntry

Source§

type SubKey = PackedStoredNibblesSubKey

Source§

fn nibbles(&self) -> &Self::SubKey

Source§

fn node(&self) -> &BranchNodeCompact

Source§

fn into_parts(self) -> (Self::SubKey, BranchNodeCompact)

Source§

fn new(nibbles: Self::SubKey, node: BranchNodeCompact) -> Self

Source§

impl StorageTrieEntryLike for StorageTrieEntry

Source§

type SubKey = StoredNibblesSubKey

Source§

fn nibbles(&self) -> &Self::SubKey

Source§

fn node(&self) -> &BranchNodeCompact

Source§

fn into_parts(self) -> (Self::SubKey, BranchNodeCompact)

Source§

fn new(nibbles: Self::SubKey, node: BranchNodeCompact) -> Self

Implementors§