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;
}Available on crate features
trie and trie-db only.Expand description
Trait for storage trie entry types that carry a subkey and node.
Needed because StorageTrieEntry and PackedStorageTrieEntry are separate structs
with different field types, but DatabaseStorageTrieCursor must access .nibbles() and
.node() generically through A::StorageValue.
Required Associated Types§
Required Methods§
Sourcefn node(&self) -> &BranchNodeCompact
fn node(&self) -> &BranchNodeCompact
Returns a reference to the branch node.
Sourcefn into_parts(self) -> (Self::SubKey, BranchNodeCompact)
fn into_parts(self) -> (Self::SubKey, BranchNodeCompact)
Decompose this value into owned parts.
Sourcefn new(nibbles: Self::SubKey, node: BranchNodeCompact) -> Self
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", so this trait is not object safe.