pub struct BlockBody<T, H = Header> {
pub transactions: Vec<T>,
pub ommers: Vec<H>,
pub withdrawals: Option<Withdrawals>,
}
Expand description
A response to GetBlockBodies
, containing bodies if any bodies were found.
Withdrawals can be optionally included at the end of the RLP encoded message.
Fields§
§transactions: Vec<T>
Transactions in this block.
ommers: Vec<H>
Ommers/uncles header.
withdrawals: Option<Withdrawals>
Block withdrawals.
Implementations§
Source§impl<T, H> BlockBody<T, H>
impl<T, H> BlockBody<T, H>
Sourcepub fn transactions(&self) -> impl Iterator<Item = &T> + '_
pub fn transactions(&self) -> impl Iterator<Item = &T> + '_
Returns an iterator over all transactions.
Sourcepub const fn into_block(self, header: H) -> Block<T, H>
pub const fn into_block(self, header: H) -> Block<T, H>
Create a Block
from the body and its header.
Sourcepub fn calculate_ommers_root(&self) -> B256where
H: Encodable,
pub fn calculate_ommers_root(&self) -> B256where
H: Encodable,
Calculate the ommers root for the block body.
Sourcepub fn calculate_withdrawals_root(&self) -> Option<B256>
pub fn calculate_withdrawals_root(&self) -> Option<B256>
Calculate the withdrawals root for the block body, if withdrawals exist. If there are no
withdrawals, this will return None
.
Sourcepub fn map_ommers<U>(self, f: impl FnMut(H) -> U) -> BlockBody<T, U>
pub fn map_ommers<U>(self, f: impl FnMut(H) -> U) -> BlockBody<T, U>
Converts the body’s ommers type by applying a function to it.
Source§impl<T: Transaction, H> BlockBody<T, H>
impl<T: Transaction, H> BlockBody<T, H>
Sourcepub fn blob_versioned_hashes_iter(&self) -> impl Iterator<Item = &B256> + '_
pub fn blob_versioned_hashes_iter(&self) -> impl Iterator<Item = &B256> + '_
Returns an iterator over all blob versioned hashes from the block body.
Source§impl<T: Typed2718, H> BlockBody<T, H>
impl<T: Typed2718, H> BlockBody<T, H>
Sourcepub fn has_eip4844_transactions(&self) -> bool
pub fn has_eip4844_transactions(&self) -> bool
Returns whether or not the block body contains any blob transactions.
Sourcepub fn has_eip7702_transactions(&self) -> bool
pub fn has_eip7702_transactions(&self) -> bool
Returns whether or not the block body contains any EIP-7702 transactions.
Sourcepub fn eip4844_transactions_iter(&self) -> impl Iterator<Item = &T> + '_
pub fn eip4844_transactions_iter(&self) -> impl Iterator<Item = &T> + '_
Returns an iterator over all blob transactions of the block.
Trait Implementations§
Source§impl<'de, T, H> Deserialize<'de> for BlockBody<T, H>where
T: Deserialize<'de>,
H: Deserialize<'de>,
impl<'de, T, H> Deserialize<'de> for BlockBody<T, H>where
T: Deserialize<'de>,
H: 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>,
impl<T: Eq, H: Eq> Eq for BlockBody<T, H>
impl<T, H> StructuralPartialEq for BlockBody<T, H>
Auto Trait Implementations§
impl<T, H> Freeze for BlockBody<T, H>
impl<T, H> RefUnwindSafe for BlockBody<T, H>where
T: RefUnwindSafe,
H: RefUnwindSafe,
impl<T, H> Send for BlockBody<T, H>
impl<T, H> Sync for BlockBody<T, H>
impl<T, H> Unpin for BlockBody<T, H>
impl<T, H> UnwindSafe for BlockBody<T, H>where
T: UnwindSafe,
H: 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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more