pub struct HashedStorage {
pub storage: B256Map<U256>,
}Expand description
Representation of in-memory hashed storage.
Fields§
§storage: B256Map<U256>Mapping of hashed storage slot to storage value.
Implementations§
Source§impl HashedStorage
impl HashedStorage
Sourcepub fn from_iter(iter: impl IntoIterator<Item = (B256, U256)>) -> Self
pub fn from_iter(iter: impl IntoIterator<Item = (B256, U256)>) -> Self
Create new hashed storage from iterator.
Sourcepub fn from_plain_storage<'a>(
storage: impl IntoIterator<Item = (&'a U256, &'a U256)>,
) -> Self
pub fn from_plain_storage<'a>( storage: impl IntoIterator<Item = (&'a U256, &'a U256)>, ) -> Self
Create new hashed storage from plain storage.
Sourcepub fn construct_prefix_set(&self) -> PrefixSetMut
pub fn construct_prefix_set(&self) -> PrefixSetMut
Construct PrefixSetMut from hashed storage.
Sourcepub fn extend(&mut self, other: &Self)
pub fn extend(&mut self, other: &Self)
Extend hashed storage with contents of other. The entries in second hashed storage take precedence.
Sourcepub fn extend_from_sorted(&mut self, sorted: &HashedStorageSorted)
pub fn extend_from_sorted(&mut self, sorted: &HashedStorageSorted)
Extend hashed storage with sorted data, converting directly into the unsorted HashMap
representation. This is more efficient than first converting to HashedStorage and
then extending, as it avoids creating intermediate HashMap allocations.
Sourcepub fn into_sorted(self) -> HashedStorageSorted
pub fn into_sorted(self) -> HashedStorageSorted
Converts hashed storage into HashedStorageSorted.
Sourcepub fn clone_into_sorted(&self) -> HashedStorageSorted
pub fn clone_into_sorted(&self) -> HashedStorageSorted
Creates a sorted copy without consuming self.
More efficient than .clone().into_sorted() as it avoids cloning HashMap metadata.
Trait Implementations§
Source§impl Clone for HashedStorage
impl Clone for HashedStorage
Source§impl Debug for HashedStorage
impl Debug for HashedStorage
Source§impl Default for HashedStorage
impl Default for HashedStorage
Source§impl<'de> Deserialize<'de> for HashedStorage
Available on crate feature serde only.
impl<'de> Deserialize<'de> for HashedStorage
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, HashedStorage> for HashedStorage<'de>
Available on crate feature serde-bincode-compat only.
impl<'de> DeserializeAs<'de, HashedStorage> for HashedStorage<'de>
serde-bincode-compat only.Source§fn deserialize_as<D>(deserializer: D) -> Result<HashedStorage, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<HashedStorage, D::Error>where
D: Deserializer<'de>,
impl Eq for HashedStorage
Source§impl<'a> From<&'a HashedStorage> for HashedStorage<'a>
Available on crate feature serde-bincode-compat only.
impl<'a> From<&'a HashedStorage> for HashedStorage<'a>
serde-bincode-compat only.Source§fn from(value: &'a HashedStorage) -> Self
fn from(value: &'a HashedStorage) -> Self
Source§impl<'a> From<HashedStorage<'a>> for HashedStorage
Available on crate feature serde-bincode-compat only.
impl<'a> From<HashedStorage<'a>> for HashedStorage
serde-bincode-compat only.Source§fn from(value: HashedStorage<'a>) -> Self
fn from(value: HashedStorage<'a>) -> Self
Source§impl From<HashedStorageSorted> for HashedStorage
impl From<HashedStorageSorted> for HashedStorage
Source§fn from(sorted: HashedStorageSorted) -> Self
fn from(sorted: HashedStorageSorted) -> Self
Source§impl PartialEq for HashedStorage
impl PartialEq for HashedStorage
Source§impl Serialize for HashedStorage
Available on crate feature serde only.
impl Serialize for HashedStorage
serde only.Source§impl SerializeAs<HashedStorage> for HashedStorage<'_>
Available on crate feature serde-bincode-compat only.
impl SerializeAs<HashedStorage> for HashedStorage<'_>
serde-bincode-compat only.Source§fn serialize_as<S>(
source: &HashedStorage,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(
source: &HashedStorage,
serializer: S,
) -> Result<S::Ok, S::Error>where
S: Serializer,
impl StructuralPartialEq for HashedStorage
Auto Trait Implementations§
impl Freeze for HashedStorage
impl RefUnwindSafe for HashedStorage
impl Send for HashedStorage
impl Sync for HashedStorage
impl Unpin for HashedStorage
impl UnsafeUnpin for HashedStorage
impl UnwindSafe for HashedStorage
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: 40 bytes