referrerpolicy=no-referrer-when-downgrade

Trait sc_consensus::block_import::BlockImport

source ·
pub trait BlockImport<B: BlockT> {
    type Error: Error + Send + 'static;

    // Required methods
    fn check_block<'life0, 'async_trait>(
        &'life0 self,
        block: BlockCheckParams<B>,
    ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn import_block<'life0, 'async_trait>(
        &'life0 self,
        block: BlockImportParams<B>,
    ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Block import trait.

Required Associated Types§

source

type Error: Error + Send + 'static

The error type.

Required Methods§

source

fn check_block<'life0, 'async_trait>( &'life0 self, block: BlockCheckParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check block preconditions.

source

fn import_block<'life0, 'async_trait>( &'life0 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Import a block.

Implementations on Foreign Types§

source§

impl<B: BlockT, T, E: Error + Send + 'static> BlockImport<B> for Arc<T>
where for<'r> &'r T: BlockImport<B, Error = E>, T: Send + Sync,

§

type Error = E

source§

fn check_block<'life0, 'async_trait>( &'life0 self, block: BlockCheckParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn import_block<'life0, 'async_trait>( &'life0 self, block: BlockImportParams<B>, ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<B: BlockT> BlockImport<B> for BoxBlockImport<B>

§

type Error = Error