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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! The enqueue capability an application calls directly, in its own transaction — decision #37,
//! ADR 0036 amendment B: there is no facade type between the caller and the store.
use ;
/// Enqueuing a typed message in the caller's own transaction. A provider (`PostgresOutboxStore`)
/// implements this directly, alongside [`crate::OutboxStore`]; there is no separate handle type
/// to construct.
///
/// `Tx` is the provider's transaction type: `sqlx::Transaction<'_, Postgres>` for
/// `reliar-store-postgres`. It is a **type parameter** precisely so this crate names no storage
/// type (SRS §19.6), and one implementor may support several.
///
/// Deliberately **not** a method on [`crate::OutboxStore`]: enqueuing takes a transaction handle
/// the claim side never sees, `OutboxStore` is already published, and a GAT `type Tx<'a>` would
/// have to spell `&'a mut Transaction<'c, _>` and reintroduce an invariance problem.
///
/// **Two methods, one call each** (decision #42, ADR 0037 amendment A, shape D): a required
/// [`Self::enqueue_envelope`] that every implementor writes, and a provided [`Self::enqueue`] —
/// the fire-and-forget spelling — built on top of it. Earlier shapes tried an `impl
/// Into<Envelope<T>>` parameter (shape B) so one method covered both a bare `T: Message` and an
/// already-built `Envelope<T>`; the human rejected it (decision #42) for a second, explicit
/// method instead — no inference trick, no `Envelope<T>: !Message` invariant to guard.
///
/// **One serialized twin, deliberately absent** (decision #38, ADR 0036 amendment B.10): a
/// `enqueue_serialized(&mut tx, &SerializedEnvelope)` existed briefly and was cut for having no
/// production caller; re-adding it is additive.
///
/// Renamed from `OutboxStaging` in 0.4.0 (decision #34); `stage` became `enqueue`, and the
/// facade `OutboxPublisher` that briefly wrapped it (0.4.0, never released) was withdrawn before
/// shipping in favor of calling this trait directly (decision #37).