Skip to main content

DownloadClient

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.

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
where &'a T: Send + Sync + Debug,

Source§

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

Source§

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

Implementors§

Source§

impl DownloadClient for TestFullBlockClient

Available on crate features test-utils only.
Source§

impl DownloadClient for TestHeadersClient

Available on crate features test-utils only.
Source§

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

Source§

impl<F: Sync + Send> DownloadClient for TestBodiesClient<F>

Available on crate features test-utils only.
Source§

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

Available on crate features test-utils only.
Source§

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

Implements the DownloadClient trait for the NoopFullBlockClient struct.