op_alloy_network

Trait BlockResponse

pub trait BlockResponse {
    type Header: HeaderResponse;
    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§

type Header: HeaderResponse

Header type

type Transaction: TransactionResponse

Transaction type

Required Methods§

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

Block header

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

Block transactions

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

Mutable reference to block transactions

Provided Methods§

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

Returns the other field from WithOtherFields type.

Implementations on Foreign Types§

§

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

§

type Header = <T as BlockResponse>::Header

§

type Transaction = <T as BlockResponse>::Transaction

§

fn header(&self) -> &<WithOtherFields<T> as BlockResponse>::Header

§

fn transactions( &self, ) -> &BlockTransactions<<WithOtherFields<T> as BlockResponse>::Transaction>

§

fn transactions_mut( &mut self, ) -> &mut BlockTransactions<<WithOtherFields<T> as BlockResponse>::Transaction>

§

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

§

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

§

type Transaction = T

§

type Header = H

§

fn header(&self) -> &<Block<T, H> as BlockResponse>::Header

§

fn transactions(&self) -> &BlockTransactions<T>

§

fn transactions_mut( &mut self, ) -> &mut BlockTransactions<<Block<T, H> as BlockResponse>::Transaction>

Implementors§