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;
}
Available on crate feature network only.
Expand description

Generic download client for peer penalization

Required Methods§

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

Returns how many peers the network is currently connected to.

Implementations on Foreign Types§

Source§

impl DownloadClient for TestBodiesClient

Source§

fn report_bad_message(&self, _peer_id: FixedBytes<64>)

Source§

fn num_connected_peers(&self) -> usize

§

impl<'a, T> DownloadClient for &'a T
where T: 'a + DownloadClient + ?Sized, &'a T: Send + Sync + Debug,

§

fn report_bad_message(&self, peer_id: FixedBytes<64>)

§

fn num_connected_peers(&self) -> usize

Source§

impl<B> DownloadClient for FileClient<B>
where B: FullBlock,

Source§

fn report_bad_message(&self, _peer_id: FixedBytes<64>)

Source§

fn num_connected_peers(&self) -> usize

§

impl<T> DownloadClient for Box<T>
where T: DownloadClient + ?Sized, Box<T>: Send + Sync + Debug,

§

fn report_bad_message(&self, peer_id: FixedBytes<64>)

§

fn num_connected_peers(&self) -> usize

§

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

§

fn report_bad_message(&self, peer_id: FixedBytes<64>)

§

fn num_connected_peers(&self) -> usize

Implementors§

§

impl DownloadClient for NoopFullBlockClient

Implements the DownloadClient trait for the NoopFullBlockClient struct.

§

impl DownloadClient for TestFullBlockClient

§

impl DownloadClient for TestHeadersClient

§

impl<A, B> DownloadClient for Either<A, B>

§

impl<F> DownloadClient for reth_op::network::p2p::test_utils::TestBodiesClient<F>
where F: Sync + Send,

Source§

impl<N> DownloadClient for FetchClient<N>