Skip to main content

TraceHandler

Trait TraceHandler 

Source
pub trait TraceHandler: Send + Sync {
    // Required methods
    fn handle_trace<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        trace: &'life1 CallTrace,
        ctx: &'life2 IndexContext,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Trait for user-provided trace processing logic.

Implement this to react to call traces during indexing (e.g., track ETH transfers, monitor contract creations, record internal function calls).

Required Methods§

Source

fn handle_trace<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, trace: &'life1 CallTrace, ctx: &'life2 IndexContext, ) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called for each trace that passes the handler’s filter.

Source

fn name(&self) -> &str

Human-readable name for this handler (used in error messages and logging).

Implementors§