1use crate::{download::DownloadClient, error::PeerRequestResult, priority::Priority};
2use futures::Future;
3use reth_eth_wire_types::snap::{AccountRangeMessage, GetAccountRangeMessage};
45/// The snap sync downloader client
6#[auto_impl::auto_impl(&, Arc, Box)]
7pub trait SnapClient: DownloadClient {
8/// The output future type for account range requests
9type Output: Future<Output = PeerRequestResult<AccountRangeMessage>> + Send + Sync + Unpin;
1011/// Sends the account range request to the p2p network and returns the account range
12 /// response received from a peer.
13fn get_account_range(&self, request: GetAccountRangeMessage) -> Self::Output {
14self.get_account_range_with_priority(request, Priority::Normal)
15 }
1617/// Sends the account range request to the p2p network with priority set and returns
18 /// the account range response received from a peer.
19fn get_account_range_with_priority(
20&self,
21 request: GetAccountRangeMessage,
22 priority: Priority,
23 ) -> Self::Output;
24}