Struct HashedStorage
pub struct HashedStorage {
pub storage: HashMap<FixedBytes<32>, Uint<256, 4>, FbBuildHasher<32>>,
}Expand description
Representation of in-memory hashed storage.
Fields§
§storage: HashMap<FixedBytes<32>, Uint<256, 4>, FbBuildHasher<32>>Mapping of hashed storage slot to storage value.
Implementations§
§impl HashedStorage
impl HashedStorage
pub fn from_iter(
iter: impl IntoIterator<Item = (FixedBytes<32>, Uint<256, 4>)>,
) -> HashedStorage
pub fn from_iter( iter: impl IntoIterator<Item = (FixedBytes<32>, Uint<256, 4>)>, ) -> HashedStorage
Create new hashed storage from iterator.
pub fn from_plain_storage<'a>(
storage: impl IntoIterator<Item = (&'a Uint<256, 4>, &'a Uint<256, 4>)>,
) -> HashedStorage
pub fn from_plain_storage<'a>( storage: impl IntoIterator<Item = (&'a Uint<256, 4>, &'a Uint<256, 4>)>, ) -> HashedStorage
Create new hashed storage from plain storage.
pub fn construct_prefix_set(&self) -> PrefixSetMut
pub fn construct_prefix_set(&self) -> PrefixSetMut
Construct PrefixSetMut from hashed storage.
pub fn extend(&mut self, other: &HashedStorage)
pub fn extend(&mut self, other: &HashedStorage)
Extend hashed storage with contents of other. The entries in second hashed storage take precedence.
pub 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.
pub fn into_sorted(self) -> HashedStorageSorted
pub fn into_sorted(self) -> HashedStorageSorted
Converts hashed storage into HashedStorageSorted.
pub 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§
§impl Clone for HashedStorage
impl Clone for HashedStorage
§fn clone(&self) -> HashedStorage
fn clone(&self) -> HashedStorage
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 HashedStorage
impl Debug for HashedStorage
§impl Default for HashedStorage
impl Default for HashedStorage
§fn default() -> HashedStorage
fn default() -> HashedStorage
§impl<'de> Deserialize<'de> for HashedStorage
impl<'de> Deserialize<'de> for HashedStorage
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HashedStorage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HashedStorage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<'de> DeserializeAs<'de, HashedStorage> for HashedStorage<'de>
impl<'de> DeserializeAs<'de, HashedStorage> for HashedStorage<'de>
§fn deserialize_as<D>(
deserializer: D,
) -> Result<HashedStorage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(
deserializer: D,
) -> Result<HashedStorage, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for HashedStorage
§impl<'a> From<&'a HashedStorage> for HashedStorage<'a>
impl<'a> From<&'a HashedStorage> for HashedStorage<'a>
§fn from(value: &'a HashedStorage) -> HashedStorage<'a>
fn from(value: &'a HashedStorage) -> HashedStorage<'a>
§impl<'a> From<HashedStorage<'a>> for HashedStorage
impl<'a> From<HashedStorage<'a>> for HashedStorage
§fn from(value: HashedStorage<'a>) -> HashedStorage
fn from(value: HashedStorage<'a>) -> HashedStorage
§impl From<HashedStorageSorted> for HashedStorage
impl From<HashedStorageSorted> for HashedStorage
§fn from(sorted: HashedStorageSorted) -> HashedStorage
fn from(sorted: HashedStorageSorted) -> HashedStorage
§impl PartialEq for HashedStorage
impl PartialEq for HashedStorage
§impl Serialize for HashedStorage
impl Serialize for HashedStorage
§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<HashedStorage> for HashedStorage<'_>
impl SerializeAs<HashedStorage> for HashedStorage<'_>
§fn serialize_as<S>(
source: &HashedStorage,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize_as<S>(
source: &HashedStorage,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::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> 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: 40 bytes