Trait ReceiptProvider
pub trait ReceiptProvider: Send + Sync {
type Receipt: Receipt;
// Required methods
fn receipt(&self, id: u64) -> Result<Option<Self::Receipt>, ProviderError>;
fn receipt_by_hash(
&self,
hash: FixedBytes<32>,
) -> Result<Option<Self::Receipt>, ProviderError>;
fn receipts_by_block(
&self,
block: HashOrNumber,
) -> Result<Option<Vec<Self::Receipt>>, ProviderError>;
fn receipts_by_tx_range(
&self,
range: impl RangeBounds<u64>,
) -> Result<Vec<Self::Receipt>, ProviderError>;
}
Expand description
Client trait for fetching receipt data.
Required Associated Types§
type Receipt: Receipt
type Receipt: Receipt
The receipt type.
Required Methods§
fn receipt(&self, id: u64) -> Result<Option<Self::Receipt>, ProviderError>
fn receipt(&self, id: u64) -> Result<Option<Self::Receipt>, ProviderError>
Get receipt by transaction number
Returns None
if the transaction is not found.
fn receipt_by_hash(
&self,
hash: FixedBytes<32>,
) -> Result<Option<Self::Receipt>, ProviderError>
fn receipt_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<Self::Receipt>, ProviderError>
Get receipt by transaction hash.
Returns None
if the transaction is not found.
fn receipts_by_block(
&self,
block: HashOrNumber,
) -> Result<Option<Vec<Self::Receipt>>, ProviderError>
fn receipts_by_block( &self, block: HashOrNumber, ) -> Result<Option<Vec<Self::Receipt>>, ProviderError>
Get receipts by block num or hash.
Returns None
if the block is not found.
fn receipts_by_tx_range(
&self,
range: impl RangeBounds<u64>,
) -> Result<Vec<Self::Receipt>, ProviderError>
fn receipts_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<Self::Receipt>, ProviderError>
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§
§impl<'a, T> ReceiptProvider for &'a T
impl<'a, T> ReceiptProvider for &'a T
type Receipt = <T as ReceiptProvider>::Receipt
fn receipt( &self, id: u64, ) -> Result<Option<<&'a T as ReceiptProvider>::Receipt>, ProviderError>
fn receipt_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<<&'a T as ReceiptProvider>::Receipt>, ProviderError>
fn receipts_by_block( &self, block: HashOrNumber, ) -> Result<Option<Vec<<&'a T as ReceiptProvider>::Receipt>>, ProviderError>
fn receipts_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<<&'a T as ReceiptProvider>::Receipt>, ProviderError>
§impl<T> ReceiptProvider for Arc<T>
impl<T> ReceiptProvider for Arc<T>
type Receipt = <T as ReceiptProvider>::Receipt
fn receipt( &self, id: u64, ) -> Result<Option<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>
fn receipt_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>
fn receipts_by_block( &self, block: HashOrNumber, ) -> Result<Option<Vec<<Arc<T> as ReceiptProvider>::Receipt>>, ProviderError>
fn receipts_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>
Implementors§
Source§impl ReceiptProvider for MockEthProvider
Available on crate feature test-utils
only.
impl ReceiptProvider for MockEthProvider
Available on crate feature
test-utils
only.