pub trait BlockSource {
type Error;
// Required method
fn with_blocks<F, WalletErrT>(
&self,
from_height: Option<BlockHeight>,
limit: Option<usize>,
with_block: F,
) -> Result<(), Error<WalletErrT, Self::Error>>
where F: FnMut(CompactBlock) -> Result<(), Error<WalletErrT, Self::Error>>;
}Expand description
This trait provides sequential access to raw blockchain data via a callback-oriented API.
Required Associated Types§
Required Methods§
Sourcefn with_blocks<F, WalletErrT>(
&self,
from_height: Option<BlockHeight>,
limit: Option<usize>,
with_block: F,
) -> Result<(), Error<WalletErrT, Self::Error>>
fn with_blocks<F, WalletErrT>( &self, from_height: Option<BlockHeight>, limit: Option<usize>, with_block: F, ) -> Result<(), Error<WalletErrT, Self::Error>>
Scan the specified limit number of blocks from the blockchain, starting at
from_height, applying the provided callback to each block. If from_height
is None then scanning will begin at the first available block.
WalletErrT: the types of errors produced by the wallet operations performed as part of processing each row.NoteRefT: the type of note identifiers in the wallet data store, for use in reporting errors related to specific notes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl BlockSource for MockBlockSource
Available on crate feature test-dependencies only.
impl BlockSource for MockBlockSource
Available on crate feature
test-dependencies only.