Skip to main content

DownloadClient

Trait DownloadClient 

Source
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§

Source

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

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DownloadClient for TestBodiesClient

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl DownloadClient for TestFullBlockClient

Source§

impl DownloadClient for TestHeadersClient

Source§

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

Source§

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

Source§

impl<F> DownloadClient for TestReceiptsClient<F>
where F: Sync + Send,

Source§

impl<N> DownloadClient for FetchClient<N>

Source§

impl<Net> DownloadClient for NoopFullBlockClient<Net>
where Net: Debug + Send + Sync,

Implements the DownloadClient trait for the NoopFullBlockClient struct.