Trait DownloadClient
pub trait DownloadClient:
Send
+ Sync
+ Debug {
// Required methods
fn report_bad_message(&self, peer_id: FixedBytes<64>);
fn num_connected_peers(&self) -> usize;
}
Expand description
Generic download client for peer penalization
Required Methods§
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn report_bad_message(&self, peer_id: FixedBytes<64>)
Penalize the peer for responding with a message that violates validation rules
fn num_connected_peers(&self) -> usize
fn num_connected_peers(&self) -> usize
Returns how many peers the network is currently connected to.
Implementations on Foreign Types§
§impl DownloadClient for TestBodiesClient
impl DownloadClient for TestBodiesClient
fn report_bad_message(&self, _peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<'a, T> DownloadClient for &'a T
impl<'a, T> DownloadClient for &'a T
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<B> DownloadClient for FileClient<B>where
B: FullBlock,
impl<B> DownloadClient for FileClient<B>where
B: FullBlock,
fn report_bad_message(&self, _peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<T> DownloadClient for Box<T>
impl<T> DownloadClient for Box<T>
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<T> DownloadClient for Arc<T>
impl<T> DownloadClient for Arc<T>
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
Implementors§
impl DownloadClient for TestFullBlockClient
impl DownloadClient for TestHeadersClient
impl<A, B> DownloadClient for Either<A, B>where
A: DownloadClient,
B: DownloadClient,
impl<F> DownloadClient for reth::network::p2p::test_utils::TestBodiesClient<F>
impl<N> DownloadClient for FetchClient<N>where
N: NetworkPrimitives,
impl<Net> DownloadClient for NoopFullBlockClient<Net>
Implements the DownloadClient
trait for the NoopFullBlockClient
struct.