Skip to main content

ReceiptsClient

Trait ReceiptsClient 

Source
pub trait ReceiptsClient: DownloadClient {
    type Receipt: TxReceipt;
    type Output: Future<Output = PeerRequestResult<ReceiptsResponse<Self::Receipt>>> + Sync + Send + Unpin;

    // Required method
    fn get_receipts_with_priority(
        &self,
        hashes: Vec<B256>,
        priority: Priority,
    ) -> Self::Output;

    // Provided method
    fn get_receipts(&self, hashes: Vec<B256>) -> Self::Output { ... }
}
Expand description

A client capable of downloading block receipts from peers.

Required Associated Types§

Source

type Receipt: TxReceipt

The receipt type this client fetches.

Source

type Output: Future<Output = PeerRequestResult<ReceiptsResponse<Self::Receipt>>> + Sync + Send + Unpin

The output of the request future for querying block receipts.

Required Methods§

Source

fn get_receipts_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output

Fetches the receipts for the requested block hashes with priority.

Provided Methods§

Source

fn get_receipts(&self, hashes: Vec<B256>) -> Self::Output

Fetches the receipts for the requested block hashes.

Implementations on Foreign Types§

Source§

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

Source§

type Receipt = <T as ReceiptsClient>::Receipt

Source§

type Output = <T as ReceiptsClient>::Output

Source§

fn get_receipts(&self, hashes: Vec<B256>) -> Self::Output

Source§

fn get_receipts_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output

Source§

impl<T: ReceiptsClient + ?Sized> ReceiptsClient for Box<T>
where Box<T>: DownloadClient,

Source§

type Receipt = <T as ReceiptsClient>::Receipt

Source§

type Output = <T as ReceiptsClient>::Output

Source§

fn get_receipts(&self, hashes: Vec<B256>) -> Self::Output

Source§

fn get_receipts_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output

Source§

impl<T: ReceiptsClient + ?Sized> ReceiptsClient for Arc<T>
where Arc<T>: DownloadClient,

Source§

type Receipt = <T as ReceiptsClient>::Receipt

Source§

type Output = <T as ReceiptsClient>::Output

Source§

fn get_receipts(&self, hashes: Vec<B256>) -> Self::Output

Source§

fn get_receipts_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output

Implementors§

Source§

impl<A, B> ReceiptsClient for Either<A, B>
where A: ReceiptsClient, B: ReceiptsClient<Receipt = A::Receipt>,

Source§

impl<F> ReceiptsClient for TestReceiptsClient<F>
where F: Fn(Vec<B256>) -> PeerRequestResult<ReceiptsResponse<Receipt>> + Send + Sync,

Available on crate features test-utils only.
Source§

type Receipt = EthereumReceipt

Source§

type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<ReceiptsResponse<EthereumReceipt>>, RequestError>> + Send + Sync>>