Struct StorageTrieUpdates
pub struct StorageTrieUpdates {
pub storage_nodes: HashMap<Nibbles, BranchNodeCompact, DefaultHashBuilder>,
pub removed_nodes: HashSet<Nibbles, DefaultHashBuilder>,
}Expand description
Trie updates for storage trie of a single account.
Fields§
§storage_nodes: HashMap<Nibbles, BranchNodeCompact, DefaultHashBuilder>Collection of updated storage trie nodes.
removed_nodes: HashSet<Nibbles, DefaultHashBuilder>Collection of removed storage trie nodes.
Implementations§
§impl StorageTrieUpdates
impl StorageTrieUpdates
pub fn new(
updates: impl IntoIterator<Item = (Nibbles, BranchNodeCompact)>,
) -> StorageTrieUpdates
Available on crate feature test-utils only.
pub fn new( updates: impl IntoIterator<Item = (Nibbles, BranchNodeCompact)>, ) -> StorageTrieUpdates
test-utils only.Creates storage trie updates from the provided nodes.
§impl StorageTrieUpdates
impl StorageTrieUpdates
pub const fn storage_nodes_ref(
&self,
) -> &HashMap<Nibbles, BranchNodeCompact, DefaultHashBuilder>
pub const fn storage_nodes_ref( &self, ) -> &HashMap<Nibbles, BranchNodeCompact, DefaultHashBuilder>
Returns reference to updated storage nodes.
pub const fn removed_nodes_ref(&self) -> &HashSet<Nibbles, DefaultHashBuilder>
pub const fn removed_nodes_ref(&self) -> &HashSet<Nibbles, DefaultHashBuilder>
Returns reference to removed storage nodes.
pub fn extend(&mut self, other: StorageTrieUpdates)
pub fn extend(&mut self, other: StorageTrieUpdates)
Extends storage trie updates.
pub fn extend_ref(&mut self, other: &StorageTrieUpdates)
pub fn extend_ref(&mut self, other: &StorageTrieUpdates)
Extends storage trie updates.
Slightly less efficient than Self::extend, but preferred to extend(other.clone()).
pub 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.
pub fn finalize(
&mut self,
hash_builder: HashBuilder,
removed_keys: HashSet<Nibbles, DefaultHashBuilder>,
)
pub fn finalize( &mut self, hash_builder: HashBuilder, removed_keys: HashSet<Nibbles, DefaultHashBuilder>, )
Finalize storage trie updates for by taking updates from walker and hash builder.
pub fn into_sorted(self) -> StorageTrieUpdatesSorted
pub fn into_sorted(self) -> StorageTrieUpdatesSorted
Convert storage trie updates into StorageTrieUpdatesSorted.
pub 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.
pub fn to_sorted_ref(&self) -> StorageTrieUpdatesSortedRef<'_>
pub fn to_sorted_ref(&self) -> StorageTrieUpdatesSortedRef<'_>
Allocates sorted collections borrowing the storage updates as
StorageTrieUpdatesSortedRef.
Trait Implementations§
§impl Clone for StorageTrieUpdates
impl Clone for StorageTrieUpdates
§fn clone(&self) -> StorageTrieUpdates
fn clone(&self) -> StorageTrieUpdates
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for StorageTrieUpdates
impl Debug for StorageTrieUpdates
§impl Default for StorageTrieUpdates
impl Default for StorageTrieUpdates
§fn default() -> StorageTrieUpdates
fn default() -> StorageTrieUpdates
§impl<'de> Deserialize<'de> for StorageTrieUpdates
impl<'de> Deserialize<'de> for StorageTrieUpdates
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageTrieUpdates, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageTrieUpdates, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<'de> DeserializeAs<'de, StorageTrieUpdates> for StorageTrieUpdates<'de>
impl<'de> DeserializeAs<'de, StorageTrieUpdates> for StorageTrieUpdates<'de>
§fn deserialize_as<D>(
deserializer: D,
) -> Result<StorageTrieUpdates, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<StorageTrieUpdates, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for StorageTrieUpdates
§impl<'a> From<&'a StorageTrieUpdates> for StorageTrieUpdates<'a>
impl<'a> From<&'a StorageTrieUpdates> for StorageTrieUpdates<'a>
§fn from(value: &'a StorageTrieUpdates) -> StorageTrieUpdates<'a>
fn from(value: &'a StorageTrieUpdates) -> StorageTrieUpdates<'a>
§impl<'a> From<StorageTrieUpdates<'a>> for StorageTrieUpdates
impl<'a> From<StorageTrieUpdates<'a>> for StorageTrieUpdates
§fn from(value: StorageTrieUpdates<'a>) -> StorageTrieUpdates
fn from(value: StorageTrieUpdates<'a>) -> StorageTrieUpdates
§impl From<StorageTrieUpdatesSorted> for StorageTrieUpdates
impl From<StorageTrieUpdatesSorted> for StorageTrieUpdates
§fn from(sorted: StorageTrieUpdatesSorted) -> StorageTrieUpdates
fn from(sorted: StorageTrieUpdatesSorted) -> StorageTrieUpdates
§impl PartialEq for StorageTrieUpdates
impl PartialEq for StorageTrieUpdates
§impl Serialize for StorageTrieUpdates
impl Serialize for StorageTrieUpdates
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl SerializeAs<StorageTrieUpdates> for StorageTrieUpdates<'_>
impl SerializeAs<StorageTrieUpdates> for StorageTrieUpdates<'_>
§fn serialize_as<S>(
source: &StorageTrieUpdates,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &StorageTrieUpdates,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§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>,
Source§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