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§
Sourcefn report_bad_message(&self, peer_id: PeerId)
fn report_bad_message(&self, peer_id: PeerId)
Penalize the peer for responding with a message that violates validation rules
Sourcefn num_connected_peers(&self) -> usize
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<'a, T: 'a + DownloadClient + ?Sized> DownloadClient for &'a T
impl<'a, T: 'a + DownloadClient + ?Sized> DownloadClient for &'a T
fn report_bad_message(&self, peer_id: PeerId)
fn num_connected_peers(&self) -> usize
Source§impl<T: DownloadClient + ?Sized> DownloadClient for Arc<T>
impl<T: DownloadClient + ?Sized> DownloadClient for Arc<T>
fn report_bad_message(&self, peer_id: PeerId)
fn num_connected_peers(&self) -> usize
Source§impl<T: DownloadClient + ?Sized> DownloadClient for Box<T>
impl<T: DownloadClient + ?Sized> DownloadClient for Box<T>
fn report_bad_message(&self, peer_id: PeerId)
fn num_connected_peers(&self) -> usize
Implementors§
impl DownloadClient for TestFullBlockClient
Available on crate features
test-utils only.impl DownloadClient for TestHeadersClient
Available on crate features
test-utils only.impl<A, B> DownloadClient for Either<A, B>where
A: DownloadClient,
B: DownloadClient,
impl<F: Sync + Send> DownloadClient for TestBodiesClient<F>
Available on crate features
test-utils only.impl<F: Sync + Send> DownloadClient for TestReceiptsClient<F>
Available on crate features
test-utils only.impl<Net> DownloadClient for NoopFullBlockClient<Net>
Implements the DownloadClient trait for the NoopFullBlockClient struct.