pub struct StorageTrieUpdates {
pub storage_nodes: HashMap<Nibbles, BranchNodeCompact>,
pub removed_nodes: HashSet<Nibbles>,
}Expand description
Trie updates for storage trie of a single account.
Fields§
§storage_nodes: HashMap<Nibbles, BranchNodeCompact>Collection of updated storage trie nodes.
removed_nodes: HashSet<Nibbles>Collection of removed storage trie nodes.
Implementations§
Source§impl StorageTrieUpdates
impl StorageTrieUpdates
Sourcepub fn new(
updates: impl IntoIterator<Item = (Nibbles, BranchNodeCompact)>,
) -> Self
Available on crate feature test-utils only.
pub fn new( updates: impl IntoIterator<Item = (Nibbles, BranchNodeCompact)>, ) -> Self
test-utils only.Creates storage trie updates from the provided nodes.
Source§impl StorageTrieUpdates
impl StorageTrieUpdates
Sourcepub const fn storage_nodes_ref(&self) -> &HashMap<Nibbles, BranchNodeCompact>
pub const fn storage_nodes_ref(&self) -> &HashMap<Nibbles, BranchNodeCompact>
Returns reference to updated storage nodes.
Sourcepub const fn removed_nodes_ref(&self) -> &HashSet<Nibbles>
pub const fn removed_nodes_ref(&self) -> &HashSet<Nibbles>
Returns reference to removed storage nodes.
Sourcepub fn extend_ref(&mut self, other: &Self)
pub fn extend_ref(&mut self, other: &Self)
Extends storage trie updates.
Slightly less efficient than Self::extend, but preferred to extend(other.clone()).
Sourcepub fn extend_from_sorted(&mut self, sorted: &StorageTrieUpdatesSorted)
pub fn extend_from_sorted(&mut self, sorted: &StorageTrieUpdatesSorted)
Extend storage trie updates with sorted data, converting directly into the unsorted
HashMap representation. This is more efficient than first converting to
StorageTrieUpdates and then extending, as it avoids creating intermediate HashMap
allocations.
This is invoked from TrieUpdates::extend_from_sorted for each account.
Sourcepub fn finalize(
&mut self,
hash_builder: HashBuilder,
removed_keys: HashSet<Nibbles>,
)
pub fn finalize( &mut self, hash_builder: HashBuilder, removed_keys: HashSet<Nibbles>, )
Finalize storage trie updates for by taking updates from walker and hash builder.
Sourcepub fn into_sorted(self) -> StorageTrieUpdatesSorted
pub fn into_sorted(self) -> StorageTrieUpdatesSorted
Convert storage trie updates into StorageTrieUpdatesSorted.
Sourcepub fn clone_into_sorted(&self) -> StorageTrieUpdatesSorted
pub fn clone_into_sorted(&self) -> StorageTrieUpdatesSorted
Creates a sorted copy without consuming self.
More efficient than .clone().into_sorted() as it avoids cloning HashMap metadata.
Sourcepub fn to_sorted_ref(&self) -> StorageTrieUpdatesSortedRef<'_>
pub fn to_sorted_ref(&self) -> StorageTrieUpdatesSortedRef<'_>
Allocates sorted collections borrowing the storage updates as
StorageTrieUpdatesSortedRef.
Trait Implementations§
Source§impl Clone for StorageTrieUpdates
impl Clone for StorageTrieUpdates
Source§impl Debug for StorageTrieUpdates
impl Debug for StorageTrieUpdates
Source§impl Default for StorageTrieUpdates
impl Default for StorageTrieUpdates
Source§impl<'de> Deserialize<'de> for StorageTrieUpdates
Available on crate features serde only.
impl<'de> Deserialize<'de> for StorageTrieUpdates
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'de> DeserializeAs<'de, StorageTrieUpdates> for StorageTrieUpdates<'de>
Available on crate feature serde-bincode-compat only.
impl<'de> DeserializeAs<'de, StorageTrieUpdates> for StorageTrieUpdates<'de>
serde-bincode-compat only.Source§fn deserialize_as<D>(deserializer: D) -> Result<StorageTrieUpdates, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<StorageTrieUpdates, D::Error>where
D: Deserializer<'de>,
impl Eq for StorageTrieUpdates
Source§impl<'a> From<&'a StorageTrieUpdates> for StorageTrieUpdates<'a>
Available on crate feature serde-bincode-compat only.
impl<'a> From<&'a StorageTrieUpdates> for StorageTrieUpdates<'a>
serde-bincode-compat only.Source§fn from(value: &'a StorageTrieUpdates) -> Self
fn from(value: &'a StorageTrieUpdates) -> Self
Source§impl<'a> From<StorageTrieUpdates<'a>> for StorageTrieUpdates
Available on crate feature serde-bincode-compat only.
impl<'a> From<StorageTrieUpdates<'a>> for StorageTrieUpdates
serde-bincode-compat only.Source§fn from(value: StorageTrieUpdates<'a>) -> Self
fn from(value: StorageTrieUpdates<'a>) -> Self
Source§impl From<StorageTrieUpdatesSorted> for StorageTrieUpdates
impl From<StorageTrieUpdatesSorted> for StorageTrieUpdates
Source§fn from(sorted: StorageTrieUpdatesSorted) -> Self
fn from(sorted: StorageTrieUpdatesSorted) -> Self
Source§impl PartialEq for StorageTrieUpdates
impl PartialEq for StorageTrieUpdates
Source§impl Serialize for StorageTrieUpdates
Available on crate features serde only.
impl Serialize for StorageTrieUpdates
serde only.Source§impl SerializeAs<StorageTrieUpdates> for StorageTrieUpdates<'_>
Available on crate feature serde-bincode-compat only.
impl SerializeAs<StorageTrieUpdates> for StorageTrieUpdates<'_>
serde-bincode-compat only.Source§fn serialize_as<S>(
source: &StorageTrieUpdates,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &StorageTrieUpdates,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
impl StructuralPartialEq for StorageTrieUpdates
Auto Trait Implementations§
impl Freeze for StorageTrieUpdates
impl RefUnwindSafe for StorageTrieUpdates
impl Send for StorageTrieUpdates
impl Sync for StorageTrieUpdates
impl Unpin for StorageTrieUpdates
impl UnsafeUnpin for StorageTrieUpdates
impl UnwindSafe for StorageTrieUpdates
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 80 bytes