reth_network_p2p::download

Trait DownloadClient

source
pub trait DownloadClient:
    Send
    + Sync
    + Debug {
    // Required methods
    fn report_bad_message(&self, peer_id: PeerId);
    fn num_connected_peers(&self) -> usize;
}
Expand description

Generic download client for peer penalization

Required Methods§

source

fn report_bad_message(&self, peer_id: PeerId)

Penalize the peer for responding with a message that violates validation rules

source

fn num_connected_peers(&self) -> usize

Returns how many peers the network is currently connected to.

Implementations on Foreign Types§

source§

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

source§

fn report_bad_message(&self, peer_id: PeerId)

source§

fn num_connected_peers(&self) -> usize

source§

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

source§

fn report_bad_message(&self, peer_id: PeerId)

source§

fn num_connected_peers(&self) -> usize

source§

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

source§

fn report_bad_message(&self, peer_id: PeerId)

source§

fn num_connected_peers(&self) -> usize

Implementors§

source§

impl DownloadClient for NoopFullBlockClient

Available on crate feature test-utils only.

Implements the DownloadClient trait for the NoopFullBlockClient struct.

source§

impl DownloadClient for TestFullBlockClient

Available on crate feature test-utils only.
source§

impl DownloadClient for TestHeadersClient

Available on crate feature test-utils only.
source§

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

source§

impl<F: Sync + Send> DownloadClient for TestBodiesClient<F>

Available on crate feature test-utils only.