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.