pub enum PayloadOrAttributes<'a, Payload, Attributes> {
ExecutionPayload(&'a Payload),
PayloadAttributes(&'a Attributes),
}Expand description
A unified type for handling both execution payloads and payload attributes.
Enables generic validation and processing logic for both complete payloads and payload attributes, useful for version-specific validation.
Variants§
ExecutionPayload(&'a Payload)
A complete execution payload containing block data
PayloadAttributes(&'a Attributes)
Attributes specifying how to build a new payload
Implementations§
Source§impl<'a, Payload, Attributes> PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> PayloadOrAttributes<'a, Payload, Attributes>
Sourcepub const fn from_execution_payload(payload: &'a Payload) -> Self
pub const fn from_execution_payload(payload: &'a Payload) -> Self
Creates a PayloadOrAttributes from an execution payload reference
Sourcepub const fn from_attributes(attributes: &'a Attributes) -> Self
pub const fn from_attributes(attributes: &'a Attributes) -> Self
Creates a PayloadOrAttributes from a payload attributes reference
Source§impl<Payload, Attributes> PayloadOrAttributes<'_, Payload, Attributes>where
Payload: ExecutionPayload,
Attributes: PayloadAttributes,
impl<Payload, Attributes> PayloadOrAttributes<'_, Payload, Attributes>where
Payload: ExecutionPayload,
Attributes: PayloadAttributes,
Sourcepub fn withdrawals(&self) -> Option<&Vec<Withdrawal>>
pub fn withdrawals(&self) -> Option<&Vec<Withdrawal>>
Returns withdrawals from either the payload or attributes.
Sourcepub fn parent_beacon_block_root(&self) -> Option<B256>
pub fn parent_beacon_block_root(&self) -> Option<B256>
Returns the parent beacon block root from either the payload or attributes.
Sourcepub const fn message_validation_kind(&self) -> MessageValidationKind
pub const fn message_validation_kind(&self) -> MessageValidationKind
Determines the validation context based on the contained type.
Sourcepub fn block_access_list(&self) -> Option<&Bytes>
pub fn block_access_list(&self) -> Option<&Bytes>
Returns block_access_list from payload.
Sourcepub fn slot_number(&self) -> Option<u64>
pub fn slot_number(&self) -> Option<u64>
Returns slot_number from payload or attributes.
Sourcepub fn target_gas_limit(&self) -> Option<u64>
pub fn target_gas_limit(&self) -> Option<u64>
Returns target_gas_limit from payload attributes.
Source§impl<Attributes> PayloadOrAttributes<'_, ExecutionData, Attributes>where
Attributes: PayloadAttributes,
Extended functionality for Ethereum execution payloads
impl<Attributes> PayloadOrAttributes<'_, ExecutionData, Attributes>where
Attributes: PayloadAttributes,
Extended functionality for Ethereum execution payloads
Sourcepub fn execution_requests(&self) -> Option<&Requests>
pub fn execution_requests(&self) -> Option<&Requests>
Extracts execution layer requests from the payload.
Returns Some(requests) if this is an execution payload with request data,
None otherwise.
Trait Implementations§
Source§impl<'a, Payload: Debug, Attributes: Debug> Debug for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload: Debug, Attributes: Debug> Debug for PayloadOrAttributes<'a, Payload, Attributes>
Source§impl<'a, Payload, AttributesType> From<&'a AttributesType> for PayloadOrAttributes<'a, Payload, AttributesType>where
AttributesType: PayloadAttributes,
impl<'a, Payload, AttributesType> From<&'a AttributesType> for PayloadOrAttributes<'a, Payload, AttributesType>where
AttributesType: PayloadAttributes,
Source§fn from(attributes: &'a AttributesType) -> Self
fn from(attributes: &'a AttributesType) -> Self
Auto Trait Implementations§
impl<'a, Payload, Attributes> Freeze for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> RefUnwindSafe for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> Send for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> Sync for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> Unpin for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> UnsafeUnpin for PayloadOrAttributes<'a, Payload, Attributes>
impl<'a, Payload, Attributes> UnwindSafe for PayloadOrAttributes<'a, Payload, Attributes>
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
§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> 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: 16 bytes
Size for each variant:
ExecutionPayload: 8 bytesPayloadAttributes: 8 bytes