1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! [`OutboxRecordId`]: the surrogate row id, `pk_outbox` (ADR 0044 §1).
reliar_core::uuid_id!(
/// Identifies one `outbox` row — `pk_outbox`, and the handle every by-row operation and the
/// dead-letter cursor quote. **Assigned by the database** (`DEFAULT uuidv7()`), never minted
/// by the caller: the row does not exist before the `INSERT`, and no caller receives the
/// value before the row is read back (ADR 0044 §1). Distinct from [`reliar_core::MessageId`],
/// which the client mints and the wire carries.
///
/// Unlike [`crate::WorkerId`] and `reliar-inbox`'s `InboxRecordId`, it has **no `new()`**:
/// nothing needs the value before the row is `INSERT`ed, and no caller receives one as a
/// *default* value the way an application mints a fresh `MessageId` — every `OutboxRecordId`
/// a caller ever holds came from reading a row back (ADR 0044 §1, mirroring ADR 0038's
/// reasoning for a derived id). No `Default`, no `FromStr` — no caller.
///
/// ```
/// use reliar_outbox::OutboxRecordId;
/// use reliar_core::uuid::Uuid;
///
/// let raw = Uuid::now_v7();
/// let id = OutboxRecordId::from_uuid(raw);
/// assert_eq!(id.as_uuid(), raw);
/// ```
///
/// `no_mint` means there is no `new()` — pins ADR 0044 §1 (assigned by the database, never
/// minted by the caller):
///
/// ```compile_fail
/// use reliar_outbox::OutboxRecordId;
///
/// let _ = OutboxRecordId::new();
/// ```
///
/// … and no `Default`, for the same reason:
///
/// ```compile_fail
/// use reliar_outbox::OutboxRecordId;
///
/// let _ = OutboxRecordId::default();
/// ```
OutboxRecordId in reliar_outbox,
no_mint
);
#[cfg(feature = "serde")]
reliar_core::uuid_id_serde!(OutboxRecordId);