pub trait EventHandler: Send + Sync {
    type SharedState: Send + Sync + Clone + Debug;

    // Required methods
    fn abi(&self) -> &'static str;
    fn handle_event<'a, 'life0, 'async_trait>(
        &'life0 self,
        event_context: EventHandlerContext<'a, Self::SharedState>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

source

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

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

source

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

Implementors§