Trait chaindexing::EventHandler

source ·
pub trait EventHandler: Send + Sync {
    // Required methods
    fn abi(&self) -> &'static str;
    fn handle_event<'a, 'b, 'life0, 'async_trait>(
        &'life0 self,
        context: PureHandlerContext<'a, 'b>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'b: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Pure handlers do not contain any side effects. They are simple reducers that derive or index states deterministically.

Required Methods§

source

fn abi(&self) -> &'static str

The human-readable ABI of the event being handled. For example, Uniswap’s PoolCreated event’s abi is: PoolCreated(address indexed token0, address indexed token1, uint24 indexed fee, int24 tickSpacing, address pool). The chain explorer’s event section can also be used to infer this.

source

fn handle_event<'a, 'b, 'life0, 'async_trait>( &'life0 self, context: PureHandlerContext<'a, 'b> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'b: 'async_trait, 'life0: 'async_trait,

Implementors§