Struct alloy_consensus::BlockBody
source · pub struct BlockBody<T> {
pub transactions: Vec<T>,
pub ommers: Vec<Header>,
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<Header>
Ommers/uncles header.
withdrawals: Option<Withdrawals>
Block withdrawals.
Implementations§
source§impl<T> BlockBody<T>
impl<T> BlockBody<T>
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: Header) -> Block<T>
pub const fn into_block(self, header: Header) -> Block<T>
Create a Block
from the body and its header.
source§impl<T> BlockBody<T>
impl<T> BlockBody<T>
sourcepub fn calculate_ommers_root(&self) -> B256
pub fn calculate_ommers_root(&self) -> B256
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
.
source§impl<T: Transaction> BlockBody<T>
impl<T: Transaction> BlockBody<T>
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> BlockBody<T>
impl<T: Typed2718> BlockBody<T>
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> Deserialize<'de> for BlockBody<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for BlockBody<T>where
T: 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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq> PartialEq for BlockBody<T>
impl<T: PartialEq> PartialEq for BlockBody<T>
impl<T: Eq> Eq for BlockBody<T>
impl<T> StructuralPartialEq for BlockBody<T>
Auto Trait Implementations§
impl<T> Freeze for BlockBody<T>
impl<T> RefUnwindSafe for BlockBody<T>where
T: RefUnwindSafe,
impl<T> Send for BlockBody<T>where
T: Send,
impl<T> Sync for BlockBody<T>where
T: Sync,
impl<T> Unpin for BlockBody<T>where
T: Unpin,
impl<T> UnwindSafe for BlockBody<T>where
T: 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
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.