pub struct Block<T = Transaction, H = Header> {
pub header: H,
pub uncles: Vec<FixedBytes<32>>,
pub transactions: BlockTransactions<T>,
pub size: Option<Uint<256, 4>>,
pub withdrawals: Option<Vec<Withdrawal>>,
}
Available on crate feature
eth
only.Expand description
Block representation
Fields§
§header: H
Header of the block.
uncles: Vec<FixedBytes<32>>
Uncles’ hashes.
transactions: BlockTransactions<T>
Block Transactions. In the case of an uncle block, this field is not included in RPC responses, and when deserialized, it will be set to BlockTransactions::Uncle.
size: Option<Uint<256, 4>>
Integer the size of this block in bytes.
withdrawals: Option<Vec<Withdrawal>>
Withdrawals in the block.
Implementations§
source§impl<T, H> Block<T, H>where
T: TransactionResponse,
impl<T, H> Block<T, H>where
T: TransactionResponse,
sourcepub fn into_full_block(self, txs: Vec<T>) -> Block<T, H>
pub fn into_full_block(self, txs: Vec<T>) -> Block<T, H>
Converts a block with Tx hashes into a full block.
Trait Implementations§
source§impl<T, H> BlockResponse for Block<T, H>where
T: TransactionResponse,
H: HeaderResponse,
impl<T, H> BlockResponse for Block<T, H>where
T: TransactionResponse,
H: HeaderResponse,
source§type Transaction = T
type Transaction = T
Transaction type
source§fn transactions(&self) -> &BlockTransactions<T>
fn transactions(&self) -> &BlockTransactions<T>
Block transactions
source§fn transactions_mut(
&mut self,
) -> &mut BlockTransactions<<Block<T, H> as BlockResponse>::Transaction>
fn transactions_mut( &mut self, ) -> &mut BlockTransactions<<Block<T, H> as BlockResponse>::Transaction>
Mutable reference to block transactions
source§fn other_fields(&self) -> Option<&OtherFields>
fn other_fields(&self) -> Option<&OtherFields>
Returns the
other
field from WithOtherFields
type.source§impl<'de, T, H> Deserialize<'de> for Block<T, H>where
T: Deserialize<'de>,
H: Deserialize<'de>,
impl<'de, T, H> Deserialize<'de> for Block<T, H>where
T: Deserialize<'de>,
H: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block<T, H>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Block<T, H>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T, H> Serialize for Block<T, H>
impl<T, H> Serialize for Block<T, H>
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T, H> Eq for Block<T, H>
impl<T, H> StructuralPartialEq for Block<T, H>
Auto Trait Implementations§
impl<T, H> Freeze for Block<T, H>where
H: Freeze,
impl<T, H> RefUnwindSafe for Block<T, H>where
H: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, H> Send for Block<T, H>
impl<T, H> Sync for Block<T, H>
impl<T, H> Unpin for Block<T, H>
impl<T, H> UnwindSafe for Block<T, H>where
H: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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§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>
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 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>
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