pub trait ProvidesScannableBlocks: Sync {
// Required methods
fn contiguous_scannable_blocks(
&self,
range: RangeInclusive<usize>,
) -> impl Send + Future<Output = Result<Vec<ScannableBlock>, InterfaceError>>;
fn scannable_block(
&self,
hash: [u8; 32],
) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>;
fn scannable_block_by_number(
&self,
number: usize,
) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>;
}Expand description
Provides scannable blocks which have been sanity-checked.
Required Methods§
Sourcefn contiguous_scannable_blocks(
&self,
range: RangeInclusive<usize>,
) -> impl Send + Future<Output = Result<Vec<ScannableBlock>, InterfaceError>>
fn contiguous_scannable_blocks( &self, range: RangeInclusive<usize>, ) -> impl Send + Future<Output = Result<Vec<ScannableBlock>, InterfaceError>>
Get a contiguous range of ScannableBlocks.
The blocks will be validated to build upon each other, as expected, have the expected numbers, and have the expected transactions according to the block’s list of transactions.
Sourcefn scannable_block(
&self,
hash: [u8; 32],
) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>
fn scannable_block( &self, hash: [u8; 32], ) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>
Get a ScannableBlock by its hash.
The block will be validated to be the requested block with a well-formed number and have the expected transactions according to the block’s list of transactions.
Sourcefn scannable_block_by_number(
&self,
number: usize,
) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>
fn scannable_block_by_number( &self, number: usize, ) -> impl Send + Future<Output = Result<ScannableBlock, InterfaceError>>
Get a ScannableBlock by its number.
The number of a block is its index on the blockchain, so the genesis block would have
number = 0.
The block will be validated to be a block with the requested number and have the expected transactions according to the block’s list of transactions.
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.