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

Header type

Source

type Transaction: TransactionResponse

Transaction type

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>

Mutable reference to block transactions

Provided Methods§

Source

fn other_fields(&self) -> Option<&OtherFields>

Returns the other field from WithOtherFields type.

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§