pub trait CompensationIdempotencyStore: Send + Sync {
// Required methods
fn was_compensated<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn mark_compensated<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Idempotency store contract for compensation execution deduplication.
Production-stable since 0.12 (M156). Ensures that compensation actions
are executed at most once even when retried after a process restart.
Built-in adapters: InMemoryCompensationIdempotencyStore,
[PostgresCompensationIdempotencyStore] (feature persistence-postgres),
[RedisCompensationIdempotencyStore] (feature persistence-redis).