Trait sp_consensus::block_import::BlockImport[][src]

pub trait BlockImport<B: BlockT> {
    type Error: Error + Send + 'static;
    type Transaction: Send + 'static;
    #[must_use]
    fn check_block<'life0, 'async_trait>(
        &'life0 mut self,
        block: BlockCheckParams<B>
    ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn import_block<'life0, 'async_trait>(
        &'life0 mut self,
        block: BlockImportParams<B, Self::Transaction>,
        cache: HashMap<CacheKeyId, Vec<u8>>
    ) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Block import trait.

Associated Types

type Error: Error + Send + 'static[src]

The error type.

type Transaction: Send + 'static[src]

The transaction type used by the backend.

Loading content...

Required methods

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

Check block preconditions.

#[must_use]
fn import_block<'life0, 'async_trait>(
    &'life0 mut self,
    block: BlockImportParams<B, Self::Transaction>,
    cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Import a block.

Cached data can be accessed through the blockchain cache.

Loading content...

Implementations on Foreign Types

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

type Error = E

type Transaction = Transaction

Loading content...

Implementors

impl<B: BlockT, Transaction> BlockImport<B> for BoxBlockImport<B, Transaction> where
    Transaction: Send + 'static, 
[src]

type Error = Error

type Transaction = Transaction

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

Check block preconditions.

fn import_block<'life0, 'async_trait>(
    &'life0 mut self,
    block: BlockImportParams<B, Transaction>,
    cache: HashMap<CacheKeyId, Vec<u8>>
) -> Pin<Box<dyn Future<Output = Result<ImportResult, Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Import a block.

Cached data can be accessed through the blockchain cache.

Loading content...