Trait reth::rpc::api::servers::eth::helpers::block::LoadBlock

source ·
pub trait LoadBlock: LoadPendingBlock + SpawnBlocking {
    // Required methods
    fn provider(&self) -> impl BlockReaderIdExt;
    fn cache(&self) -> &EthStateCache;

    // Provided methods
    fn block(
        &self,
        block_id: BlockId,
    ) -> impl Future<Output = Result<Option<SealedBlock>, EthApiError>> + Send { ... }
    fn block_with_senders(
        &self,
        block_id: BlockId,
    ) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, EthApiError>> + Send { ... }
}
Expand description

Loads a block from database.

Behaviour shared by several eth_ RPC methods, not exclusive to eth_ blocks RPC methods.

Required Methods§

source

fn provider(&self) -> impl BlockReaderIdExt

Data access in default (L1) trait method implementations.

source

fn cache(&self) -> &EthStateCache

Returns a handle for reading data from memory.

Data access in default (L1) trait method implementations.

Provided Methods§

source

fn block( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<SealedBlock>, EthApiError>> + Send

Returns the block object for the given block id.

source

fn block_with_senders( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, EthApiError>> + Send

Returns the block object for the given block id.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Provider, Pool, Network, EvmConfig> LoadBlock for EthApi<Provider, Pool, Network, EvmConfig>
where EthApi<Provider, Pool, Network, EvmConfig>: LoadPendingBlock + SpawnBlocking, Provider: BlockReaderIdExt,