pub trait TipsetReceiptEventCacheHandler:
Send
+ Sync
+ 'static {
// Required methods
fn insert_receipt(&self, key: &TipsetKey, receipt: Vec<Receipt>);
fn insert_events(&self, key: &TipsetKey, events: StateEvents);
fn get_events(&self, key: &TipsetKey) -> Option<StateEvents>;
fn get_receipts(&self, key: &TipsetKey) -> Option<Vec<Receipt>>;
fn get_receipt_or_else(
&self,
key: &TipsetKey,
compute: Box<dyn FnOnce() -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>>> + Send>> + Send>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Receipt>>> + Send + '_>>;
fn get_events_or_else(
&self,
key: &TipsetKey,
compute: Box<dyn FnOnce() -> Pin<Box<dyn Future<Output = Result<StateEvents>> + Send>> + Send>,
) -> Pin<Box<dyn Future<Output = Result<StateEvents>> + Send + '_>>;
}Expand description
Defines the interface for caching and retrieving tipset-specific events and receipts.