Enum alloy_eips::eip7685::RequestsOrHash
source · pub enum RequestsOrHash {
Requests(Requests),
Hash(B256),
}
Expand description
A list of requests or a precomputed requests hash.
For testing purposes, the Hash
variant stores a precomputed requests hash. This can be useful
when the exact contents of the requests are unnecessary, and only a consistent hash value is
needed to simulate the presence of requests without holding actual data.
Variants§
Requests(Requests)
Stores a list of requests, allowing for dynamic requests hash calculation.
Hash(B256)
Stores a precomputed requests hash, used primarily for testing or mocking because the header only contains the hash.
Implementations§
source§impl RequestsOrHash
impl RequestsOrHash
sourcepub fn requests_hash(&self) -> B256
pub fn requests_hash(&self) -> B256
Returns the requests hash for the enum instance.
- If the instance contains a list of requests, this function calculates the hash using
requests_hash
of theRequests
struct. - If it contains a precomputed hash, it returns that hash directly.
sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Returns an instance with the EMPTY_REQUESTS_HASH
.
Trait Implementations§
source§impl Clone for RequestsOrHash
impl Clone for RequestsOrHash
source§fn clone(&self) -> RequestsOrHash
fn clone(&self) -> RequestsOrHash
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RequestsOrHash
impl Debug for RequestsOrHash
source§impl Default for RequestsOrHash
impl Default for RequestsOrHash
source§impl<'de> Deserialize<'de> for RequestsOrHash
impl<'de> Deserialize<'de> for RequestsOrHash
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 From<FixedBytes<32>> for RequestsOrHash
impl From<FixedBytes<32>> for RequestsOrHash
source§impl From<Requests> for RequestsOrHash
impl From<Requests> for RequestsOrHash
source§impl Hash for RequestsOrHash
impl Hash for RequestsOrHash
source§impl PartialEq for RequestsOrHash
impl PartialEq for RequestsOrHash
source§fn eq(&self, other: &RequestsOrHash) -> bool
fn eq(&self, other: &RequestsOrHash) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for RequestsOrHash
impl Serialize for RequestsOrHash
impl Eq for RequestsOrHash
impl StructuralPartialEq for RequestsOrHash
Auto Trait Implementations§
impl Freeze for RequestsOrHash
impl RefUnwindSafe for RequestsOrHash
impl Send for RequestsOrHash
impl Sync for RequestsOrHash
impl Unpin for RequestsOrHash
impl UnwindSafe for RequestsOrHash
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: 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.