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.