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.
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 Box<T>
impl<T: DownloadClient + ?Sized> DownloadClient for Box<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
Implementors§
impl DownloadClient for NoopFullBlockClient
Available on crate feature
test-utils
only.Implements the DownloadClient
trait for the NoopFullBlockClient
struct.
impl DownloadClient for TestFullBlockClient
Available on crate feature
test-utils
only.impl DownloadClient for TestHeadersClient
Available on crate feature
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 feature
test-utils
only.