pub trait ReceiptSink: Send + Sync {
// Required method
fn record(&self, receipt: RawReceipt);
}Expand description
Non-blocking enqueue boundary for RawReceipts on the paid-delivery
hot path (#803).
The voucher-accept path records a receipt through this seam as each voucher
is accepted (acceptance is implicit — delivery simply continues), so the
implementation MUST NOT block on disk I/O: a backed-up sink drops the
receipt (best-effort, audit-only) rather than stall the payment, which
already advanced the lane watermark. The runtime uses ChannelReceiptSink
(hands off to the background spawn_receipt_writer task); tests use a
synchronous fake behind the test-support DirectReceiptSink.
The seam carries a RawReceipt, not the rendered DownloadReceipt: the
hex/decimal rendering and the timestamp are applied downstream, off the hot
path (#1792 item 2).
Required Methods§
Sourcefn record(&self, receipt: RawReceipt)
fn record(&self, receipt: RawReceipt)
Best-effort, non-blocking record of one receipt. Never blocks the caller on disk and never fails delivery — a sink that cannot accept the receipt drops it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".