pub trait Indexer {
type ChangeSet;
// Required methods
fn index_txout(
&mut self,
outpoint: OutPoint,
txout: &TxOut,
) -> Self::ChangeSet;
fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet;
fn apply_changeset(&mut self, changeset: Self::ChangeSet);
fn initial_changeset(&self) -> Self::ChangeSet;
fn is_tx_relevant(&self, tx: &Transaction) -> bool;
}Expand description
Utilities for indexing transaction data.
Types which implement this trait can be used to construct an IndexedTxGraph.
This trait’s methods should rarely be called directly.
Required Associated Types§
Required Methods§
Sourcefn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet
fn index_txout(&mut self, outpoint: OutPoint, txout: &TxOut) -> Self::ChangeSet
Scan and index the given outpoint and txout.
Sourcefn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet
fn index_tx(&mut self, tx: &Transaction) -> Self::ChangeSet
Scans a transaction for relevant outpoints, which are stored and indexed internally.
Sourcefn apply_changeset(&mut self, changeset: Self::ChangeSet)
fn apply_changeset(&mut self, changeset: Self::ChangeSet)
Apply changeset to itself.
Sourcefn initial_changeset(&self) -> Self::ChangeSet
fn initial_changeset(&self) -> Self::ChangeSet
Sourcefn is_tx_relevant(&self, tx: &Transaction) -> bool
fn is_tx_relevant(&self, tx: &Transaction) -> bool
Determines whether the transaction should be included in the index.