Skip to main content

PayloadOrAttributes

Enum PayloadOrAttributes 

Source
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>

Source

pub const fn from_execution_payload(payload: &'a Payload) -> Self

Creates a PayloadOrAttributes from an execution payload reference

Source

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,

Source

pub fn withdrawals(&self) -> Option<&Vec<Withdrawal>>

Returns withdrawals from either the payload or attributes.

Source

pub fn timestamp(&self) -> u64

Returns the timestamp from either the payload or attributes.

Source

pub fn parent_beacon_block_root(&self) -> Option<B256>

Returns the parent beacon block root from either the payload or attributes.

Source

pub const fn message_validation_kind(&self) -> MessageValidationKind

Determines the validation context based on the contained type.

Source

pub fn block_access_list(&self) -> Option<&Bytes>

Returns block_access_list from payload.

Source

pub fn slot_number(&self) -> Option<u64>

Returns slot_number from payload or attributes.

Source

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

Source

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, Payload, AttributesType> From<&'a AttributesType> for PayloadOrAttributes<'a, Payload, AttributesType>
where AttributesType: PayloadAttributes,

Source§

fn from(attributes: &'a AttributesType) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<T> MaybeDebug for T
where T: Debug,

§

impl<T> NonStaticAny for T
where T: ?Sized,

§

fn type_id(&self) -> TypeId

Returns the lifetime-erased type ID of self.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

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 bytes
  • PayloadAttributes: 8 bytes