for_each_transaction_dimension

Function for_each_transaction_dimension 

Source
pub fn for_each_transaction_dimension(
    tx_data: &TransactionData,
    effects: &TransactionEffects,
    events: Option<&TransactionEvents>,
    object_set: &ObjectSet,
    f: impl FnMut(IndexDimension, &[u8]),
)
Expand description

Visit all tx-space dimensions for a transaction.

object_set is used to resolve owners for the input and output states referenced by effects.object_changes(). Callers typically pass either &checkpoint.object_set (archival) or an ObjectSet built from the transaction’s input + output objects (fullnode).

The callback is invoked once per logical tx-space dimension candidate as f(dimension, key), where key is the encoded value bytes for that dimension (the lookup key, without the dimension’s tag byte prefix). Compound dimensions are emitted at every prefix level so queries at any specificity remain a single key lookup.

This uses a visitor rather than returning owned dimension values so the extractor can reuse one scratch buffer for all compound keys emitted from a transaction instead of allocating one Vec<u8> per dimension.