pub trait BlockSource {
    type Error;

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

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.

Implementors§