pub trait BlockProvider:
Send
+ Sync
+ 'static {
type GetNextBlockFut<'a>: Future<Output = OptionalBlockStuff> + Send + 'a;
type GetBlockFut<'a>: Future<Output = OptionalBlockStuff> + Send + 'a;
type CleanupFut<'a>: Future<Output = Result<()>> + Send + 'a;
// Required methods
fn get_next_block<'a>(
&'a self,
prev_block_id: &'a BlockId,
) -> Self::GetNextBlockFut<'a>;
fn get_block<'a>(
&'a self,
block_id_relation: &'a BlockIdRelation,
) -> Self::GetBlockFut<'a>;
fn cleanup_until(&self, mc_seqno: u32) -> Self::CleanupFut<'_>;
}Expand description
Block provider MUST validate the block before returning it.
Required Associated Types§
type GetNextBlockFut<'a>: Future<Output = OptionalBlockStuff> + Send + 'a
type GetBlockFut<'a>: Future<Output = OptionalBlockStuff> + Send + 'a
type CleanupFut<'a>: Future<Output = Result<()>> + Send + 'a
Required Methods§
Sourcefn get_next_block<'a>(
&'a self,
prev_block_id: &'a BlockId,
) -> Self::GetNextBlockFut<'a>
fn get_next_block<'a>( &'a self, prev_block_id: &'a BlockId, ) -> Self::GetNextBlockFut<'a>
Wait for the next block. Mostly used for masterchain blocks.
Sourcefn get_block<'a>(
&'a self,
block_id_relation: &'a BlockIdRelation,
) -> Self::GetBlockFut<'a>
fn get_block<'a>( &'a self, block_id_relation: &'a BlockIdRelation, ) -> Self::GetBlockFut<'a>
Get the exact block. Provider must return the requested block.
Sourcefn cleanup_until(&self, mc_seqno: u32) -> Self::CleanupFut<'_>
fn cleanup_until(&self, mc_seqno: u32) -> Self::CleanupFut<'_>
Clear resources until (and including) the specified masterchain block seqno.
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.