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
//! The durable stream subscription receiver (ADR-008 §8; ADR-021 §5;
//! ADR-019 §6).
//!
//! Explicit saves only — no `save_every`, no save-on-drop (the
//! auto-checkpoint ambiguity is not inherited); checkpointing is the
//! consumer's call.
use crateResult;
use crateBoxedFuture;
use crateStreamEvent;
/// The durable stream subscription handle `StreamHandle::subscribe`
/// returns.
///
/// # Close and error arms (ADR-021 §5)
///
/// `recv()`'s `Err` arm carries `Database` only — payloads cross
/// raw, and `Codec` lives at `payload_as<T>` on the yielded
/// [`StreamEvent`]; `Closed` is the `None` arm by construction. Close
/// is terminal; what causes it is the documented engine asymmetry
/// (SQLite: watcher death; Postgres: engine shutdown — reconnect
/// wakes arrive on the receiver). A closed receiver never reopens;
/// recovery is a fresh `subscribe(consumer)` resuming from the saved
/// offset. No `recv_timeout` exists here — deliberate absence (a
/// stream consumer's steady state is wake-driven re-read; polling
/// needs are served by `try_recv` and the offset-anchored
/// `read_since`).