reth::network

Trait BlockDownloaderProvider

pub trait BlockDownloaderProvider {
    type Client: BlockClient + Send + Sync + Clone + 'static
       where <Self::Client as HeadersClient>::Header: Debug,
             <Self::Client as BodiesClient>::Body: Debug;

    // Required method
    fn fetch_client(
        &self,
    ) -> impl Future<Output = Result<Self::Client, RecvError>> + Send;
}
Expand description

Provides client for downloading blocks.

Required Associated Types§

type Client: BlockClient + Send + Sync + Clone + 'static where <Self::Client as HeadersClient>::Header: Debug, <Self::Client as BodiesClient>::Body: Debug

The client this type can provide.

Required Methods§

fn fetch_client( &self, ) -> impl Future<Output = Result<Self::Client, RecvError>> + Send

Returns a new [BlockClient], used for fetching blocks from peers.

The client is the entrypoint for sending block requests to the network.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<'a, T> BlockDownloaderProvider for &'a T
where T: 'a + BlockDownloaderProvider + ?Sized,

§

type Client = <T as BlockDownloaderProvider>::Client

§

fn fetch_client( &self, ) -> impl Future<Output = Result<<&'a T as BlockDownloaderProvider>::Client, RecvError>> + Send

§

impl<T> BlockDownloaderProvider for Arc<T>

§

type Client = <T as BlockDownloaderProvider>::Client

§

fn fetch_client( &self, ) -> impl Future<Output = Result<<Arc<T> as BlockDownloaderProvider>::Client, RecvError>> + Send

Implementors§