reth_storage_api

Trait ReceiptProviderIdExt

Source
pub trait ReceiptProviderIdExt: ReceiptProvider + BlockIdReader {
    // Provided methods
    fn receipts_by_block_id(
        &self,
        block: BlockId,
    ) -> ProviderResult<Option<Vec<Receipt>>> { ... }
    fn receipts_by_number_or_tag(
        &self,
        number_or_tag: BlockNumberOrTag,
    ) -> ProviderResult<Option<Vec<Receipt>>> { ... }
}
Expand description

Trait extension for ReceiptProvider, for types that implement BlockId conversion.

The Receipt trait should be implemented on types that can retrieve receipts from either a block number or hash. However, it might be desirable to fetch receipts from a BlockId type, which can be a number, hash, or tag such as BlockNumberOrTag::Safe.

Resolving tags requires keeping track of block hashes or block numbers associated with the tag, so this trait can only be implemented for types that implement BlockIdReader. The BlockIdReader methods should be used to resolve BlockIds to block numbers or hashes, and retrieving the receipts should be done using the type’s ReceiptProvider methods.

Provided Methods§

Source

fn receipts_by_block_id( &self, block: BlockId, ) -> ProviderResult<Option<Vec<Receipt>>>

Get receipt by block id

Source

fn receipts_by_number_or_tag( &self, number_or_tag: BlockNumberOrTag, ) -> ProviderResult<Option<Vec<Receipt>>>

Returns the block with the matching BlockId from the database.

Returns None if block is not found.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + ReceiptProviderIdExt + ?Sized> ReceiptProviderIdExt for &'a T

Source§

fn receipts_by_block_id( &self, block: BlockId, ) -> ProviderResult<Option<Vec<Receipt>>>

Source§

fn receipts_by_number_or_tag( &self, number_or_tag: BlockNumberOrTag, ) -> ProviderResult<Option<Vec<Receipt>>>

Source§

impl<T: ReceiptProviderIdExt + ?Sized> ReceiptProviderIdExt for Arc<T>

Source§

fn receipts_by_block_id( &self, block: BlockId, ) -> ProviderResult<Option<Vec<Receipt>>>

Source§

fn receipts_by_number_or_tag( &self, number_or_tag: BlockNumberOrTag, ) -> ProviderResult<Option<Vec<Receipt>>>

Implementors§