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
Available on crate feature sha2 only.
pub fn requests_hash(&self) -> B256
sha2 only.Returns the requests hash for the enum instance.
- If the instance contains a list of requests, this function calculates the hash using
requests_hashof theRequestsstruct. - 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Size for each variant:
Requests: 31 bytesHash: 32 bytes