Struct alloy_primitives::Sealed
source · pub struct Sealed<T> { /* private fields */ }
Expand description
A consensus hashable item, with its memoized hash.
We do not implement any specific hashing algorithm here. Instead types
implement the Sealable
trait to provide define their own hash.
Implementations§
source§impl<T> Sealed<T>
impl<T> Sealed<T>
sourcepub fn new_ref_with<F>(inner: &T, f: F) -> Sealed<&T>
pub fn new_ref_with<F>(inner: &T, f: F) -> Sealed<&T>
Seal a reference to the inner item with some function.
sourcepub const fn new_unchecked(inner: T, seal: B256) -> Self
pub const fn new_unchecked(inner: T, seal: B256) -> Self
Instantiate without performing the hash. This should be used carefully.
sourcepub fn into_parts(self) -> (T, B256)
pub fn into_parts(self) -> (T, B256)
Decompose into parts.
sourcepub fn split(self) -> (T, B256)
pub fn split(self) -> (T, B256)
Decompose into parts. Alias for Self::into_parts
.
sourcepub fn clone_inner(&self) -> Twhere
T: Clone,
pub fn clone_inner(&self) -> Twhere
T: Clone,
Clone the inner item.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unseal the inner item, discarding the hash.
sourcepub fn unseal(self) -> T
pub fn unseal(self) -> T
Unseal the inner item, discarding the hash. Alias for
Self::into_inner
.
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Sealed<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Sealed<T>where
T: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq> PartialEq for Sealed<T>
impl<T: PartialEq> PartialEq for Sealed<T>
impl<T: Copy> Copy for Sealed<T>
impl<T: Eq> Eq for Sealed<T>
impl<T> StructuralPartialEq for Sealed<T>
Auto Trait Implementations§
impl<T> Freeze for Sealed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Sealed<T>where
T: RefUnwindSafe,
impl<T> Send for Sealed<T>where
T: Send,
impl<T> Sync for Sealed<T>where
T: Sync,
impl<T> Unpin for Sealed<T>where
T: Unpin,
impl<T> UnwindSafe for Sealed<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.