Skip to main content

BlockResponse

Trait BlockResponse 

Source
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§

Source

type Header

Concrete RPC header representation.

Source

type Transaction: TransactionResponse

Full-transaction representation used by BlockTransactions::Full.

Required Methods§

Source

fn header(&self) -> &Self::Header

Block header

Source

fn transactions(&self) -> &BlockTransactions<Self::Transaction>

Block transactions

Source

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§

Source

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".

Implementations on Foreign Types§

Source§

impl<T, H> BlockResponse for Block<T, H>

Source§

impl<T> BlockResponse for WithOtherFields<T>
where T: BlockResponse,

Implementors§