pub trait CheckpointStore: Send + Sync {
// Required methods
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, IndexerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn save<'life0, 'async_trait>(
&'life0 self,
checkpoint: Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for storing and loading checkpoints.
Implementations include MemoryCheckpointStore, SqliteCheckpointStore,
and PostgresCheckpointStore.
Required Methods§
Sourcefn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Checkpoint>, IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Load the latest checkpoint for a given chain + indexer pair.
Sourcefn save<'life0, 'async_trait>(
&'life0 self,
checkpoint: Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
checkpoint: Checkpoint,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save (upsert) a checkpoint.
Sourcefn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
chain_id: &'life1 str,
indexer_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), IndexerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a checkpoint (e.g. when resetting an indexer).