pub trait BlockSource {
    type Error;

    // Required method
    fn with_blocks<F, WalletErrT>(
        &self,
        from_height: Option<BlockHeight>,
        limit: Option<usize>,
        with_row: 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§

source

fn with_blocks<F, WalletErrT>( &self, from_height: Option<BlockHeight>, limit: Option<usize>, with_row: F ) -> Result<(), Error<WalletErrT, Self::Error>>where F: FnMut(CompactBlock) -> 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.

Returns an error if from_height is set to a block that does not exist in self.

  • 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.

Implementors§