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
//! [`ClaimToken`]: the per-row fencing value of one [`crate::OutboxStore::acquire`] claim (ADR
//! 0046, Amendment A).
reliar_core::uuid_id!(
/// The token of one claim of one row: [`crate::OutboxStore::acquire`] stamps a fresh one on
/// every row it claims, and every outcome write for that row must quote it back
/// (ADR 0046 Amendment A).
///
/// **Assigned by the database**, so it is never minted here — there is no `new()` and no
/// `Default`. Opaque: two tokens are only ever compared for equality, never for order, and
/// two rows of one `acquire` call carry **different** tokens (Amendment A.1) — UUIDv7 is used
/// only so a log line sorts readably, never as a correctness signal.
///
/// ```
/// use reliar_outbox::ClaimToken;
/// use reliar_core::uuid::Uuid;
///
/// let raw = Uuid::now_v7();
/// let token = ClaimToken::from_uuid(raw);
/// assert_eq!(token.as_uuid(), raw);
/// ```
///
/// `no_mint` means there is no `new()` — pins the database-assigned invariant:
///
/// ```compile_fail
/// use reliar_outbox::ClaimToken;
///
/// let _ = ClaimToken::new();
/// ```
///
/// … and no `Default`, for the same reason:
///
/// ```compile_fail
/// use reliar_outbox::ClaimToken;
///
/// let _ = ClaimToken::default();
/// ```
ClaimToken in reliar_outbox,
no_mint
);