Skip to main content

Module dead_letters

Module dead_letters 

Source
Expand description

SQLite-backed persistence for DeadLetterRecord rows.

The settle_dead_letters table is keyed by receipt_id so a finalized receipt can have at most one dead-letter row at any time. Re-inserting the same record is idempotent: a byte-identical row returns Ok(false); a different row returns DeadLetterStoreError::Conflict.

Fail-closed: once a row is persisted the kernel observer slot MUST NOT replay the failed settlement until an operator clears the row via SqliteDeadLetterStore::clear. There is no auto-retry past the documented bound.

The migration is CREATE TABLE IF NOT EXISTS plus CREATE INDEX IF NOT EXISTS, so it can run repeatedly against a receipt-store database that already holds other tables.

Structs§

SqliteDeadLetterStore
SQLite-backed dead-letter store. Wraps an existing connection pool from crate::SqliteReceiptStore so dead-letter writes share the same SQLite database and journal mode.

Enums§

DeadLetterStoreError
Errors surfaced from the SQLite-backed dead-letter store.

Constants§

SETTLE_DEAD_LETTERS_MIGRATION
SQL migration applied by SqliteDeadLetterStore::open_with_pool to create the settle_dead_letters table.