Skip to main content

LoadBlock

Trait LoadBlock 

Source
pub trait LoadBlock:
    LoadPendingBlock
    + SpawnBlocking
    + RpcNodeCoreExt {
    // Provided methods
    fn recovered_block(
        &self,
        block_id: BlockId,
    ) -> impl Future<Output = Result<Option<Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>>, Self::Error>> + Send { ... }
    fn recovered_block_and_maybe_bal(
        &self,
        block_id: BlockId,
    ) -> impl Future<Output = Result<Option<(Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>, Option<Arc<DecodedBal<Arc<Bal>>>>)>, Self::Error>> + Send { ... }
}
Expand description

Loads a block from database.

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

Provided Methods§

Source

fn recovered_block( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>>, Self::Error>> + Send

Returns the block object for the given block id.

Source

fn recovered_block_and_maybe_bal( &self, block_id: BlockId, ) -> impl Future<Output = Result<Option<(Arc<RecoveredBlock<<Self::Provider as BlockReader>::Block>>, Option<Arc<DecodedBal<Arc<Bal>>>>)>, Self::Error>> + Send

Returns the block for the given block id, together with the block’s cached block access list, if any.

The BAL is only returned if it is already cached, it is never fetched from the BAL store. Pending blocks never have a BAL.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<N, Rpc> LoadBlock for EthApi<N, Rpc>
where EthApi<N, Rpc>: LoadPendingBlock, N: RpcNodeCore, Rpc: RpcConvert<Primitives = <N as RpcNodeCore>::Primitives, Error = EthApiError>,