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<'a, T, H> Arbitrary<'a> for BlockBody<T, H>
Available on crate feature arbitrary
only.
impl<'a, T, H> Arbitrary<'a> for BlockBody<T, H>
arbitrary
only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§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§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 moreSource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<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: 36 bytes