pub trait SetupHandler: Send + Sync {
// Required methods
fn setup<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 IndexContext,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &str;
}Expand description
Handler that fires once before indexing starts.
Use this for one-time initialization tasks such as creating database tables, registering metrics, or loading reference data.
Required Methods§
Sourcefn setup<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 IndexContext,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn setup<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 IndexContext,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called once during indexer initialization, before any blocks are processed.
The context contains the starting block information.