pub trait TransactionSource {
// Required method
fn fetch_block_transactions(
&self,
block_number: u64,
) -> impl Future<Output = Result<Option<(Vec<RawTransaction>, u64)>>> + Send;
}Expand description
Abstraction over sources of transactions for big block generation.
Implementors provide transactions from different sources (RPC, database, files, etc.)
Required Methods§
Sourcefn fetch_block_transactions(
&self,
block_number: u64,
) -> impl Future<Output = Result<Option<(Vec<RawTransaction>, u64)>>> + Send
fn fetch_block_transactions( &self, block_number: u64, ) -> impl Future<Output = Result<Option<(Vec<RawTransaction>, u64)>>> + Send
Fetch transactions from a specific block number.
Returns Ok(None) if the block doesn’t exist.
Returns Ok(Some((transactions, gas_used))) with the block’s transactions and total gas.
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.