Trait DownloadClient
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§
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn report_bad_message(&self, peer_id: FixedBytes<64>)
Penalize the peer for responding with a message that violates validation rules
fn 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§
§impl DownloadClient for TestBodiesClient
impl DownloadClient for TestBodiesClient
fn report_bad_message(&self, _peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<'a, T> DownloadClient for &'a T
impl<'a, T> DownloadClient for &'a T
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<B> DownloadClient for FileClient<B>where
B: FullBlock,
impl<B> DownloadClient for FileClient<B>where
B: FullBlock,
fn report_bad_message(&self, _peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<T> DownloadClient for Box<T>
impl<T> DownloadClient for Box<T>
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
§impl<T> DownloadClient for Arc<T>
impl<T> DownloadClient for Arc<T>
fn report_bad_message(&self, peer_id: FixedBytes<64>)
fn num_connected_peers(&self) -> usize
Implementors§
impl DownloadClient for NoopFullBlockClient
Implements the DownloadClient
trait for the NoopFullBlockClient
struct.