Trait BlockImport

Source
pub trait BlockImport<Block>: Send + Sync {
    // Required method
    fn import(
        &self,
        block: Block,
        origin: BlockOrigin,
    ) -> Result<impl Future<Output = Result<(), BlockImportError>> + Send, BlockImportError>;
}
Expand description

Block import interface

Required Methods§

Source

fn import( &self, block: Block, origin: BlockOrigin, ) -> Result<impl Future<Output = Result<(), BlockImportError>> + Send, BlockImportError>

Import provided block.

Parent block must either be imported already or at least queued for import. Block import is immediately added to the queue, but actual import may not happen unless the returned future is polled.

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.

Implementors§

Source§

impl<PosTable, CI, BV> BlockImport<OwnedBeaconChainBlock> for BeaconChainBlockImport<PosTable, CI, BV>
where PosTable: Table, CI: ChainInfoWrite<OwnedBeaconChainBlock>, BV: BlockVerification<OwnedBeaconChainBlock>,