pub trait ExtractionStateGateway {
// Required methods
fn get_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
chain: &'life2 Chain,
) -> Pin<Box<dyn Future<Output = Result<ExtractionState, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ExtractionState,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Store and retrieve state of Extractors.
Sometimes extractors may wish to persist their state across restart. E.g. substreams based extractors need to store the cursor, so they can continue processing where they left off.
Extractors are uniquely identified by a name and the respective chain which they are indexing.
Required Methods§
Sourcefn get_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
chain: &'life2 Chain,
) -> Pin<Box<dyn Future<Output = Result<ExtractionState, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
chain: &'life2 Chain,
) -> Pin<Box<dyn Future<Output = Result<ExtractionState, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sourcefn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ExtractionState,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 ExtractionState,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".