pub trait BlockResponse {
type Header;
type Transaction: TransactionResponse;
// Required methods
fn header(&self) -> &Self::Header;
fn transactions(&self) -> &BlockTransactions<Self::Transaction>;
fn transactions_mut(&mut self) -> &mut BlockTransactions<Self::Transaction>;
// Provided method
fn other_fields(&self) -> Option<&OtherFields> { ... }
}Expand description
Block JSON-RPC response.
Required Associated Types§
Sourcetype Transaction: TransactionResponse
type Transaction: TransactionResponse
Full-transaction representation used by BlockTransactions::Full.
Required Methods§
Sourcefn transactions(&self) -> &BlockTransactions<Self::Transaction>
fn transactions(&self) -> &BlockTransactions<Self::Transaction>
Block transactions
Sourcefn transactions_mut(&mut self) -> &mut BlockTransactions<Self::Transaction>
fn transactions_mut(&mut self) -> &mut BlockTransactions<Self::Transaction>
Returns a mutable reference to the block transactions.
Mutating transactions does not recompute or validate header fields such as the transaction root.
Provided Methods§
Sourcefn other_fields(&self) -> Option<&OtherFields>
fn other_fields(&self) -> Option<&OtherFields>
Returns flattened chain- or client-specific RPC fields when they were retained.
The default is None. A WithOtherFields response returns Some even when its map is
empty.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".