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
//! API-001: Public `EventStore` value types.
//!
//! [`Event`] is the unit returned by every read path: it carries the
//! sequence number assigned at append time, the original payload bytes, and a
//! wall-clock timestamp captured when the event was appended. The sequence is
//! recovered from the event's tree key (see [`crate::api::event_store`]); the
//! timestamp is recovered from a fixed-width header prepended to the stored
//! value so both survive a `Database` reopen.
use crateTimestamp;
/// One appended event: its assigned sequence, payload, and append timestamp.
///
/// `seq` is the 0-based position of this event within its stream (the first
/// appended event has `seq == 0`). `timestamp` is nanoseconds since the Unix
/// epoch, captured by the `EventStore` when the event was appended.
/// One match produced by [`crate::api::event_store::EventStore::scan`]: a
/// stream key whose current sequence-number metadata satisfied the predicate.
/// Metadata handed to a [`crate::api::event_store::EventStore::scan`] predicate
/// for one stream: the stream key and its current next-sequence number (equal
/// to the number of events appended to the stream).