Trait BlockDownloader

Source
pub trait BlockDownloader: Send + Sync {
    type Block: Block;

    // Required methods
    fn on_action(&mut self, action: DownloadAction);
    fn poll(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<DownloadOutcome<Self::Block>>;
}
Expand description

A trait that can download blocks on demand.

Required Associated Types§

Source

type Block: Block

Type of the block being downloaded.

Required Methods§

Source

fn on_action(&mut self, action: DownloadAction)

Handle an action.

Source

fn poll(&mut self, cx: &mut Context<'_>) -> Poll<DownloadOutcome<Self::Block>>

Advance in progress requests if any

Implementors§

Source§

impl<B: Block> BlockDownloader for NoopBlockDownloader<B>

Source§

type Block = B

Source§

impl<Client, B> BlockDownloader for BasicBlockDownloader<Client, B>
where Client: BlockClient<Block = B>, B: Block,

Source§

type Block = B