reth_storage_api

Trait ReceiptProvider

Source
pub trait ReceiptProvider: Send + Sync {
    type Receipt: Receipt;

    // Required methods
    fn receipt(&self, id: TxNumber) -> ProviderResult<Option<Self::Receipt>>;
    fn receipt_by_hash(
        &self,
        hash: TxHash,
    ) -> ProviderResult<Option<Self::Receipt>>;
    fn receipts_by_block(
        &self,
        block: BlockHashOrNumber,
    ) -> ProviderResult<Option<Vec<Self::Receipt>>>;
    fn receipts_by_tx_range(
        &self,
        range: impl RangeBounds<TxNumber>,
    ) -> ProviderResult<Vec<Self::Receipt>>;
}
Expand description

Client trait for fetching receipt data.

Required Associated Types§

Source

type Receipt: Receipt

The receipt type.

Required Methods§

Source

fn receipt(&self, id: TxNumber) -> ProviderResult<Option<Self::Receipt>>

Get receipt by transaction number

Returns None if the transaction is not found.

Source

fn receipt_by_hash(&self, hash: TxHash) -> ProviderResult<Option<Self::Receipt>>

Get receipt by transaction hash.

Returns None if the transaction is not found.

Source

fn receipts_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<Self::Receipt>>>

Get receipts by block num or hash.

Returns None if the block is not found.

Source

fn receipts_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Self::Receipt>>

Get receipts by tx range.

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 + ReceiptProvider + ?Sized> ReceiptProvider for &'a T
where &'a T: Send + Sync,

Source§

type Receipt = <T as ReceiptProvider>::Receipt

Source§

fn receipt(&self, id: TxNumber) -> ProviderResult<Option<Self::Receipt>>

Source§

fn receipt_by_hash(&self, hash: TxHash) -> ProviderResult<Option<Self::Receipt>>

Source§

fn receipts_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<Self::Receipt>>>

Source§

fn receipts_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Self::Receipt>>

Source§

impl<T: ReceiptProvider + ?Sized> ReceiptProvider for Arc<T>
where Arc<T>: Send + Sync,

Source§

type Receipt = <T as ReceiptProvider>::Receipt

Source§

fn receipt(&self, id: TxNumber) -> ProviderResult<Option<Self::Receipt>>

Source§

fn receipt_by_hash(&self, hash: TxHash) -> ProviderResult<Option<Self::Receipt>>

Source§

fn receipts_by_block( &self, block: BlockHashOrNumber, ) -> ProviderResult<Option<Vec<Self::Receipt>>>

Source§

fn receipts_by_tx_range( &self, range: impl RangeBounds<TxNumber>, ) -> ProviderResult<Vec<Self::Receipt>>

Implementors§

Source§

impl<C: Send + Sync, N: NodePrimitives> ReceiptProvider for NoopProvider<C, N>

Source§

type Receipt = <N as NodePrimitives>::Receipt