Trait LoadBlock
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>, Self::Error>> + Send { ... }
fn block_with_senders(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, Self::Error>> + Send { ... }
}
Expand description
Loads a block from database.
Behaviour shared by several eth_
RPC methods, not exclusive to eth_
blocks RPC methods.
Required Methods§
fn provider(&self) -> impl BlockReaderIdExt
fn provider(&self) -> impl BlockReaderIdExt
Data access in default (L1) trait method implementations.
fn cache(&self) -> &EthStateCache
fn cache(&self) -> &EthStateCache
Returns a handle for reading data from memory.
Data access in default (L1) trait method implementations.
Provided Methods§
fn block(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<SealedBlock>, Self::Error>> + Send
fn block( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<SealedBlock>, Self::Error>> + Send
Returns the block object for the given block id.
fn block_with_senders(
&self,
block_id: BlockId,
) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, Self::Error>> + Send
fn block_with_senders( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<SealedBlockWithSenders>, Self::Error>> + Send
Returns the block object for the given block id.
Object Safety§
This trait is not object safe.